syncfusion-angular-license
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSyncfusion Angular Licensing
Syncfusion Angular 许可指南
This skill guides you through Syncfusion Angular licensing requirements, license key generation, registration methods, and troubleshooting validation errors.
本技能将指导你了解Syncfusion Angular的许可要求、许可密钥生成、注册方法以及验证错误的故障排除。
Table of Contents
目录
Licensing Overview
许可概述
Syncfusion license key validation was introduced in the 2022 Volume 1 release (v20.1.0.47) for Essential JS2 platforms. All Angular applications referencing Syncfusion packages from npm, CDN, or build must register a valid license key to avoid validation warnings.
Syncfusion许可密钥验证在2022年第1版发布(v20.1.0.47)时引入到Essential JS2平台。所有从npm、CDN引用Syncfusion包或构建的Angular应用都必须注册有效的许可密钥,以避免验证警告。
Key Licensing Details
关键许可细节
License Key vs Unlock Key:
- License Key: String registered in application code to validate Syncfusion package usage
- Unlock Key: Used only during Syncfusion installer process
- ⚠️ Important: License key is NOT the same as installer unlock key
Core Requirements:
- License key validation introduced in v20.1.0.47+ (2022 Volume 1)
- License keys are version and platform/edition specific
- Validation occurs offline (no internet required during runtime)
- Required when using npm packages or trial installers
- Not required when using licensed installers
License Types:
- Trial license: 30-day evaluation period, full functionality, generates trial key, displays warning after expiration
- Community license: Free for qualifying individuals/organizations (<$1M USD revenue), same functionality as paid license, annual renewal required
- Paid license: Commercial license for enterprise use, perpetual or subscription-based, technical support included
Edition-Based vs Platform-Based:
- v31.1.17+ (Edition-based): UI Edition, Document SDK, PDF Viewer SDK, DOCX Editor SDK, Spreadsheet Editor SDK, Enterprise Edition (all editions combined)
- v30.x.x and earlier (Platform-based): Angular, React, Vue, JavaScript, Blazor, etc.
Build Server Scenarios:
- Using npm packages: License key required - register using or NPX command
registerLicense() - Using trial installer: License key required - trial warnings appear after 30 days
- Using licensed installer: License key NOT required - embedded license validation included
Offline Validation:
- No internet connection required during application runtime
- License validated locally against package metadata at startup
- Works in air-gapped environments and offline development
- No external API calls or performance impact
许可密钥与解锁密钥的区别:
- 许可密钥: 在应用代码中注册的字符串,用于验证Syncfusion包的使用权限
- 解锁密钥: 仅在Syncfusion安装程序过程中使用
- ⚠️ 重要提示: 许可密钥与安装程序解锁密钥并非同一概念
核心要求:
- 许可密钥验证从v20.1.0.47+(2022年第1版)开始引入
- 许可密钥与版本和平台/版本类型绑定
- 验证过程离线进行(运行时无需联网)
- 使用npm包或试用安装程序时必须注册
- 使用授权安装程序时无需注册
许可类型:
- 试用许可: 30天评估期,功能完整,可生成试用密钥,过期后会显示警告
- 社区许可: 符合条件的个人或组织(年收入<$100万美元)可免费使用,功能与付费许可相同,需每年续期
- 付费许可: 企业商用许可,支持永久授权或订阅模式,包含技术支持
基于版本类型与基于平台的许可:
- v31.1.17+(基于版本类型): UI Edition、Document SDK、PDF Viewer SDK、DOCX Editor SDK、Spreadsheet Editor SDK、Enterprise Edition(包含所有版本类型)
- v30.x.x及更早版本(基于平台): Angular、React、Vue、JavaScript、Blazor等
构建服务器场景:
- 使用npm包: 需许可密钥 - 通过或NPX命令注册
registerLicense() - 使用试用安装程序: 需许可密钥 - 30天后会出现试用警告
- 使用授权安装程序: 无需许可密钥 - 已嵌入许可验证
离线验证:
- 应用运行时无需联网
- 启动时会根据包元数据在本地验证许可
- 适用于隔离网络环境和离线开发
- 不会调用外部API,也不会影响性能
Documentation and Navigation Guide
文档与导航指南
Generating License Keys
生成许可密钥
📄 Read: references/license-generation.md
- Edition-based licensing (v31.1.17+): UI Edition, Document SDK, PDF Viewer SDK, DOCX Editor SDK, Spreadsheet Editor SDK, Enterprise Edition
- Platform-based licensing (v30.x.x and earlier): Angular, JavaScript, React, etc.
- Generating keys from License & Downloads page
- Claim License Key page usage
- Version and platform specific license key
📄 阅读: references/license-generation.md
- 基于版本类型的许可(v31.1.17+): UI Edition、Document SDK、PDF Viewer SDK、DOCX Editor SDK、Spreadsheet Editor SDK、Enterprise Edition
- 基于平台的许可(v30.x.x及更早版本): Angular、JavaScript、React等
- 从许可与下载页面生成密钥
- 申领许可密钥页面的使用方法
- 与版本和平台绑定的许可密钥
Registering License Keys
注册许可密钥
📄 Read: references/license-registration.md
- Direct registration in main.ts with
registerLicense() - NPX command registration:
npx syncfusion-license activate - License file method:
syncfusion-license.txt - Environment variable method:
SYNCFUSION_LICENSE - CI/CD integration: GitHub Actions, Azure Pipelines
- Active license, active trial, expired license scenarios
📄 阅读: references/license-registration.md
- 在main.ts中通过直接注册
registerLicense() - NPX命令注册:
npx syncfusion-license activate - 许可文件方法:
syncfusion-license.txt - 环境变量方法:
SYNCFUSION_LICENSE - CI/CD集成:GitHub Actions、Azure Pipelines
- 有效许可、有效试用、过期许可的场景处理
Troubleshooting License Errors
许可错误故障排除
📄 Read: references/licensing-errors.md
- License key not registered error
- Invalid key error
- Trial expired error (30 days)
- Platform mismatch error
- Version mismatch error
- NPX command validation errors
📄 阅读: references/licensing-errors.md
- 未注册许可密钥错误
- 无效密钥错误
- 试用过期错误(30天)
- 平台不匹配错误
- 版本不匹配错误
- NPX命令验证错误
Quick Start
快速入门
1. Generate License Key
1. 生成许可密钥
Visit License & Downloads page:
For v31.1.17+ (Edition-based):
- Select version 31.x.x or higher
- Select required editions: UI Edition, Document SDK, PDF Viewer SDK, DOCX Editor SDK, Spreadsheet Editor SDK
- Recommended: Select all 5 editions for Enterprise Edition key
- Click "Get License Key"
For v30.x.x and earlier (Platform-based):
- Select version 30.x.x or earlier
- Select platforms: Angular, JavaScript, etc.
- Click "Get License Key"
访问许可与下载页面:
适用于v31.1.17+(基于版本类型):
- 选择31.x.x或更高版本
- 选择所需版本类型:UI Edition、Document SDK、PDF Viewer SDK、DOCX Editor SDK、Spreadsheet Editor SDK
- 推荐: 选择全部5个版本类型以获取Enterprise Edition密钥
- 点击“Get License Key”
适用于v30.x.x及更早版本(基于平台):
- 选择30.x.x或更早版本
- 选择平台:Angular、JavaScript等
- 点击“Get License Key”
2. Register License Key in Application
2. 在应用中注册许可密钥
typescript
// src/main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppComponent } from './app/app.component';
// Register Syncfusion license key
registerLicense('YOUR_LICENSE_KEY_HERE');
bootstrapApplication(AppComponent);Note: Thepackage is a dependency for all Syncfusion components and will be automatically installed when you install any Syncfusion Angular package. You don't need to explicitly add it to your@syncfusion/ej2-basefile.package.json
typescript
// src/main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppComponent } from './app/app.component';
// Register Syncfusion license key
registerLicense('YOUR_LICENSE_KEY_HERE');
bootstrapApplication(AppComponent);注意:包是所有Syncfusion组件的依赖项,当你安装任何Syncfusion Angular包时会自动安装。你无需手动将其添加到@syncfusion/ej2-base文件中。package.json
Common Registration Methods
常见注册方法
Direct Registration (Recommended for Simple Apps)
直接注册(推荐用于简单应用)
typescript
// src/main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppComponent } from './app/app.component';
registerLicense('Replace your generated license key here');
bootstrapApplication(AppComponent);typescript
// src/main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppComponent } from './app/app.component';
registerLicense('Replace your generated license key here');
bootstrapApplication(AppComponent);Environment Variable Registration
环境变量注册
typescript
// src/main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppComponent } from './app/app.component';
import { environment } from './environments/environment';
// Use environment variable for license key
if (environment.syncfusionLicense) {
registerLicense(environment.syncfusionLicense);
}
bootstrapApplication(AppComponent);typescript
// src/environments/environment.ts
export const environment = {
production: false,
syncfusionLicense: 'your_license_key_here'
};typescript
// src/main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppComponent } from './app/app.component';
import { environment } from './environments/environment';
// Use environment variable for license key
if (environment.syncfusionLicense) {
registerLicense(environment.syncfusionLicense);
}
bootstrapApplication(AppComponent);typescript
// src/environments/environment.ts
export const environment = {
production: false,
syncfusionLicense: 'your_license_key_here'
};NPX Command Registration (Build Servers)
NPX命令注册(适用于构建服务器)
bash
undefinedbash
undefinedCreate syncfusion-license.txt in project root
Create syncfusion-license.txt in project root
echo "YOUR_LICENSE_KEY" > syncfusion-license.txt
echo "YOUR_LICENSE_KEY" > syncfusion-license.txt
Activate license
Activate license
npx syncfusion-license activate
npx syncfusion-license activate
Clear cache after activation
Clear cache after activation
rm -rf node_modules/.cache
undefinedrm -rf node_modules/.cache
undefinedGitHub Actions CI/CD
GitHub Actions CI/CD
yaml
undefinedyaml
undefined.github/workflows/build.yml
.github/workflows/build.yml
steps:
-
name: Install dependencies run: npm install
-
name: Activate Syncfusion License run: npx syncfusion-license activate env: SYNCFUSION_LICENSE: ${{ secrets.SYNCFUSION_LICENSE }}
undefinedsteps:
-
name: Install dependencies run: npm install
-
name: Activate Syncfusion License run: npx syncfusion-license activate env: SYNCFUSION_LICENSE: ${{ secrets.SYNCFUSION_LICENSE }}
undefinedAzure Pipelines CI/CD
Azure Pipelines CI/CD
yaml
undefinedyaml
undefinedazure-pipelines.yml
azure-pipelines.yml
steps:
-
script: npm install displayName: 'Install dependencies'
-
script: npx syncfusion-license activate displayName: 'Activate Syncfusion License' env: SYNCFUSION_LICENSE: $(SYNCFUSION_LICENSE)
undefinedsteps:
-
script: npm install displayName: 'Install dependencies'
-
script: npx syncfusion-license activate displayName: 'Activate Syncfusion License' env: SYNCFUSION_LICENSE: $(SYNCFUSION_LICENSE)
undefined