Licensing key visible in page source in plain text....

I am trying to register a community license in asp.net core 10 application. 

I generated the key by selecting all options except java for version 31.x.x

The problem is that unless I register in the javascript, i get the Trial version error but when I do view source on the page, the key is there in plain text and anyone can use the key. 

Is there a way that key is not available in plain text to every user out there???

Here is my Program.cs. I can confirm that key is being passed to the registration function.

       public static void Main(string[] args)

       {
           // Register Syncfusion license key as the very first step
           var sfKey = Environment.GetEnvironmentVariable("SYNCFUSION_LICENSE_KEY");
           if (string.IsNullOrWhiteSpace(sfKey))
           {
               var config = new ConfigurationBuilder()
                   .AddUserSecrets<Program>(optional: true)
                   .AddJsonFile("appsettings.json", optional: true)
                   .AddEnvironmentVariables()
                   .Build();
               sfKey = config["Syncfusion:LicenseKey"]; // place your key under Syncfusion:LicenseKey in configuration or user-secrets
           }


           if (!string.IsNullOrWhiteSpace(sfKey))
           {
               Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(sfKey.Trim());
           }
           else
           {
               throw new InvalidOperationException("Syncfusion license key is missing. Set SYNCFUSION_LICENSE_KEY or configuration key Syncfusion:LicenseKey.");
           }
Here is my _Layout.cshtml

    <script src="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2.min.js"></script>

    @{
        var jsKey = Configuration["Syncfusion:LicenseKey"]; // Use same key for JS registration
    }
    @if (!string.IsNullOrWhiteSpace(jsKey))
    {
        <script>
            // Register EJ2 JS license when loading from CDN
            if (window.ej && window.ej.base && typeof window.ej.base.registerLicense === 'function') {
                window.ej.base.registerLicense('@jsKey');
            }
        </script>
    }

1 Reply

DA Deepika Arumugasamy Syncfusion Team November 25, 2025 01:01 PM UTC

Hi Arsalan Shahid,

Thank you for reaching out.

Currently, for JavaScript controls, the license key is registered directly in the script using the registerLicense method. If you want to avoid exposing the key in your JavaScript code, we suggest using the licensed script generated from the CRGIf you are a licensed user and have downloaded the licensed script from the CRG page by logging in, there is no need to include the registerLicense method in your project. There is no further license registration is required.

For more details, please refer to the documentation: CRG for EJ2 JavaScript Common control | Syncfusion

Regards,

Deepika


Loader.
Up arrow icon