API & Integration
Integrating LicenseChain with JavaScript/TypeScript
6 min read
LicenseChain provides an official JavaScript/TypeScript SDK for easy integration into web applications and Node.js services.
## Installation
Install the SDK using npm: npm install @licensechain/sdk
## Basic Setup
Import and initialize the LicenseChain client with your API key and app ID.
## Validating a License
Use the validate method to check if a license is valid. The method returns license details including expiration date and enabled features.
## Checking Features
Use hasFeature to check if a specific feature is enabled for a license.
## Error Handling
Always handle errors appropriately. Common error codes include LICENSE_EXPIRED, LICENSE_INVALID, and RATE_LIMIT_EXCEEDED.
For more examples, see our SDK documentation.