Getting Started
Quick Start

Quick Start

Build your first NIL license in 5 minutes.

Install the SDK

npm install @nil-taxonomy/sdk

Create Your First License

Use a preset builder for common use cases:

build-license.ts
import { createCommercialLicense } from '@nil-taxonomy/sdk';
 
// Build a standard commercial license
const license = createCommercialLicense()
  .setTerritoryCountries(['US', 'CA'])
  .setTerm('2024-01-01', '2025-12-31')
  .addRestrictedCategory('alcohol')
  .addRestrictedCategory('tobacco')
  .build();
 
console.log(license);

The SDK includes 4 preset builders: createEducationalLicense(), createCommercialLicense(), createUGCLicense(), and createExclusiveLicense().

Validate the License

Always validate before using:

validate.ts
import { validateLicense } from '@nil-taxonomy/sdk';
 
const result = validateLicense(license);
 
if (!result.valid) {
  console.error('Validation errors:', result.errors);
  process.exit(1);
}
 
console.log('✓ License is valid');
 
if (result.warnings?.length) {
  console.warn('⚠ Warnings:', result.warnings);
}

Use the License

Store or transmit the license configuration:

// Save to database
await db.licenses.create({
  data: {
    athleteId: 'athlete-123',
    brandId: 'brand-456',
    licenseConfig: JSON.stringify(license),
    version: 'v1.0',
  }
});
 
// Or send to your API
await fetch('/api/contracts', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ license })
});

Common Use Cases

Educational/Documentary License

import { createEducationalLicense } from '@nil-taxonomy/sdk';
 
const eduLicense = createEducationalLicense()
  .setTerritoryGlobal()
  .setTerm('2024-01-01', '2024-12-31')
  .build();

UGC Campaign License

import { createUGCLicense } from '@nil-taxonomy/sdk';
 
const ugcLicense = createUGCLicense()
  .setTerritoryGlobal()
  .setTerm('2024-06-01', '2024-08-31')
  .setSublicensing('network_allowed')
  .build();

Exclusive Endorsement Deal

import { createExclusiveLicense } from '@nil-taxonomy/sdk';
 
const exclusiveLicense = createExclusiveLicense(['athletic_apparel', 'beverages'])
  .setTerritoryCountries(['US'])
  .setTerm('2024-01-01', '2026-12-31', true, 'annual')
  .setDataUseLevel('identified_analytics_only', true)
  .build();

Next Steps