Installation
Requirements
- Node.js >= 18.0.0
- TypeScript >= 5.0.0 (recommended)
Install the SDK
npm install @nil-taxonomy/sdkVerify Installation
Create a test file to verify the SDK is installed correctly:
test.ts
import { createCommercialLicense, validateLicense } from '@nil-taxonomy/sdk';
const license = createCommercialLicense()
.setTerritoryCountries(['US'])
.build();
const result = validateLicense(license);
console.log('Valid:', result.valid);Run the test:
npx tsx test.tsExpected output:
Valid: trueTypeScript Configuration
The SDK is fully typed. Ensure your tsconfig.json includes:
tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"strict": true
}
}Optional: API Client
If you plan to use the API client to fetch live taxonomy data, you'll also need your API key.
# Add to .env.local
NIL_TAXONOMY_API_KEY=your-key-here