Syncfusion license key should be registered, if your project using Syncfusion Vue packages reference. The generated license key is a string that needs to be registered after any Syncfusion Vue reference.
Note: Syncfusion license validation is done offline during application execution and does not require internet access. Apps registered with a Syncfusion license key can be deployed on any system that does not have an internet connection.
Generate the Syncfusion license key and register it in one of the following ways,
Register the license key in the main.js
file of the Vue project.
import { createApp } from 'vue'
import App from './App.vue'
import { registerLicense } from '@syncfusion/ej2-base';
// Registering Syncfusion license key
registerLicense('License Key');
createApp(App).mount('#app')
Only from 2022 Vol 1 v20.1.0.47, license key registration required for Essential JavaScript 2 products.
Register the license key in the index.js
file of the Nuxt project.
import Vue from 'vue'
import { registerLicense } from '@syncfusion/ej2-base';
// Registering Syncfusion license key.
registerLicense('License Key');
// Component: <ClientOnly>
Vue.component(ClientOnly.name, ClientOnly)
Register the Syncfusion license key through npx command in one of the following ways,
If both the license text file and the environment variable are used for license registration, priority is set to
syncfusion-license.txt
file. If you want to use the environment variable for license registration, then remove the license text file from the application.
The following steps show how to register the Syncfusion license key with the license text file.
syncfusion-license.txt
file in the application root directory and paste the license key.npx syncfusion-license activate
Once the Syncfusion license key is activated, the following console message will appear.
License message:
(INFO) Syncfusion License imported successfully.
.cache
folder from node modules in the application.link
.If you don’t want to use the license text file in the application, refer to this link to use an environment variable and register the Syncfusion license key.
You can set the environment variable as SYNCFUSION_LICENSE
in the system and paste the license key as a value. It can be used in all applications on your machine.
The following steps show how to set environment variable in different operating systems and register the Syncfusion license key.
setx SYNCFUSION_LICENSE "license key"
env
command to view the variables list.echo 'export SYNCFUSION_LICENSE="license key"' >> ~/.bash_profile
nano .bash_profile
ctrl+x
to exit then Y
and Enter
button to save the changes.env
command.env
command to view the variables list.export SYNCFUSION_LICENSE='license key'
SYNCFUSION_LICENSE
environment variable, restart the IDE or application terminal before using the license activation command.npx syncfusion-license activate
Once the Syncfusion license key is activated, the following console message will appear.
License message:
(INFO) Syncfusion License imported successfully.
.cache
folder from node modules in the application.link
.The following sections show how to use an environment variable in CI services.
SYNCFUSION_LICENSE
and use the license key as a value. steps:
- name: Install node modules
run: npm install
- name: Activate Syncfusion License
run: npx syncfusion-license activate
env:
SYNCFUSION_LICENSE: ${{ secrets.SYNCFUSION_LICENSE }}
SYNCFUSION_LICENSE
. Use the license key as a value.The following example shows the syntax for Windows build agents.
pool:
vmImage: 'windows-latest'
steps:
- script: call npm install
displayName: 'Install node modules'
- script: call npx syncfusion-license activate
displayName: 'Activate Syncfusion License'
env:
SYNCFUSION_LICENSE: $(SYNCFUSION_LICENSE)
The following example shows the syntax for Linux build agents.
pool:
vmImage: 'ubuntu-latest'
steps:
- script: npm install
displayName: 'Install node modules'
- script: npx syncfusion-license activate
displayName: 'Activate Syncfusion License'
env:
SYNCFUSION_LICENSE: $(SYNCFUSION_LICENSE)
SYNCFUSION_LICENSE
. Use the license key as a value.# Activate the license
npx syncfusion-license activate