We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to not expose my license key in the client side? (browser)

I am using React Typescript, and in my App.txs:

import { registerLicense } from '@syncfusion/ej2-base';

...
registerLicense('...');


It is not clear for me, how to prevent exposing my license key on client side?



3 Replies

RS Ragunath Sukumaran Syncfusion Team October 13, 2022 02:25 AM

Hi Gabor,


Greetings from Syncfusion support.


We also have a way to register the license key using the npx command. If you suspect that your license key will be exposed while registering it in the main.ts file, we suggest you to register the license key using npx command. We have provided the support, registering the license key using npx command in volume 2 2022 release (v20.2.0.36).


Please refer to the below documentation for registering the license key using npx command,

https://ej2.syncfusion.com/react/documentation/licensing/license-key-registration/#register-syncfusion-license-key-using-the-npx-command


Please get back to us if you have any queries.

Regards,
Ragunath S



GA gabor October 13, 2022 04:50 AM

Hi Ragunath,

Many thx for the answer. 

It is definitely a great help to have the license code in separate file or in the environment, this solves the problem how to not check it into git, so the license will not exposed to the source control.

I've read the documentation link, you pointed, what is not clear for me, what kind of  "trick" will do the

npx syncfusion-license activate


I mean, a) will it then only check the valid license _build_ time, so the webpacked site will not contain any license related secret, or b) it will embed the key somehow to the final webpacked result, so the site still will check it runtime, when the browser are using the SPA.







RS Ragunath Sukumaran Syncfusion Team October 14, 2022 09:21 AM

Hi Gabor,


The npx command will encrypt the license key and include it in the build, then the site will check the key in the runtime. So, it won't be exposed in the client end.


Please get back to us if you have any queries.


Regards,

Ragunath S


Loader.
Live Chat Icon For mobile
Up arrow icon