SDK Guide
License Builder

License Builder

The License Builder provides a fluent API for constructing NIL license configurations.

Preset Builders

The SDK includes 4 preset builders for common use cases:

Educational License

For documentaries, news, and classroom use:

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

Default configuration:

  • Subject scope: name, image, likeness
  • Use type: editorial, educational
  • Commercial scope: non_commercial
  • Exclusivity: none
  • Derivative rights: none
  • AI use: prohibited

Commercial License

For brand campaigns and endorsements:

import { createCommercialLicense } from '@nil-taxonomy/sdk';
 
const commercialLicense = createCommercialLicense()
  .setTerritoryCountries(['US', 'CA'])
  .setTerm('2024-01-01', '2025-12-31')
  .addRestrictedCategory('alcohol')
  .addRestrictedCategory('tobacco')
  .build();

Default configuration:

  • Subject scope: name, image, likeness
  • Use type: brand_marketing, paid_advertising
  • Commercial scope: full_commercial
  • Exclusivity: none
  • Derivative rights: limited
  • AI use: prohibited

UGC License

For meme campaigns and user-generated content:

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

Default configuration:

  • Subject scope: name, image, likeness
  • Use type: ugc_campaign
  • Commercial scope: limited_commercial
  • Exclusivity: none
  • Derivative rights: ugc_remix
  • AI use: limited_depiction_only
  • Sublicensing: network_allowed

Exclusive License

For category-exclusive endorsement deals:

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();

Default configuration:

  • Subject scope: name, image, likeness, signature_marks
  • Use type: brand_marketing, paid_advertising, product_association
  • Commercial scope: full_commercial
  • Exclusivity: category_exclusive (for specified categories)
  • Derivative rights: full_with_guardrails
  • AI use: synthetic_allowed_with_approval

Custom Builder

Build from scratch using NILLicenseBuilder:

import { NILLicenseBuilder } from '@nil-taxonomy/sdk';
 
const customLicense = new NILLicenseBuilder()
  .setSubjectScope(['name', 'image', 'likeness'])
  .setUseType(['brand_marketing'])
  .setCommercialScope('limited_commercial')
  .setExclusivity('none')
  .setTerritoryGlobal()
  .setDerivativeRights('limited')
  .setAISyntheticUse('prohibited')
  .setDataUseLevel('aggregated_anon')
  .setAttribution('name_required')
  .setSublicensing('prohibited')
  .setContentSafety({
    restricted_categories: ['adult', 'tobacco'],
    morals_clause: 'standard',
  })
  .build();

Builder Methods

Subject Scope

builder.setSubjectScope(['name', 'image', 'likeness', 'signature_marks'])

Available values:

  • name - Athlete's legal name
  • image - Photographs and video
  • likeness - Recognizable representation
  • signature_marks - Unique identifiers
  • synthetic_likeness - AI-generated representations
  • performance_data - Stats and analytics

Use Type

builder.setUseType(['brand_marketing', 'paid_advertising'])

Available values:

  • editorial - News and journalism
  • educational - Teaching and research
  • brand_marketing - Brand campaigns
  • paid_advertising - Paid media
  • product_association - Product placement
  • ugc_campaign - User-generated content
  • internal_only - Internal use

Territory

Set geographic scope:

// Global rights
builder.setTerritoryGlobal()
 
// Specific countries
builder.setTerritoryCountries(['US', 'CA', 'MX'])
 
// Specific regions
builder.setTerritoryRegions(['North America', 'Europe'])
 
// Specific states (US)
builder.setTerritoryStates(['CA', 'NY', 'TX'])

Term (Time Period)

// Fixed term
builder.setTerm('2024-01-01', '2025-12-31')
 
// Auto-renewing term
builder.setTerm('2024-01-01', '2025-12-31', true, 'annual')
//                                          ^^^^ auto-renew
//                                                ^^^^^^^^ renewal period
 
// Perpetual (no end date)
builder.setTermPerpetual()
 
// Campaign duration (flexible)
builder.setTermCampaignDuration('2024-Q3')

Exclusivity

// No exclusivity
builder.setExclusivity('none')
 
// Category exclusive
builder.setExclusivityCategories(['athletic_apparel', 'beverages'])
 
// Full exclusive
builder.setExclusivityFull()

Available categories:

  • QSR - Quick service restaurants
  • sports_betting - Sports betting/gambling
  • athletic_apparel - Athletic wear
  • beverages - Drinks
  • supplements - Supplements
  • automotive - Cars
  • technology - Tech products
  • financial_services - Financial services

Derivative Rights

builder.setDerivativeRights('limited')

Levels:

  • none - No modifications allowed
  • limited - Minor edits (crop, resize, color correction)
  • ugc_remix - Transformative UGC
  • full_with_guardrails - Full rights with approval process

AI & Synthetic Use

builder.setAISyntheticUse('limited_depiction_only')

Levels:

  • prohibited - No AI use
  • limited_depiction_only - Only existing images/videos
  • avatar_only - Virtual avatar creation
  • synthetic_allowed_with_approval - With prior approval
  • synthetic_fully_allowed - Unrestricted AI use

Data Use

builder.setDataUseLevel('identified_analytics_only', true)
//                                                    ^^^^ opt-in required

Levels:

  • none - No data collection
  • aggregated_anon - Anonymous aggregated data
  • identified_analytics_only - Performance analytics
  • marketing_allowed - Marketing use permitted

Content Safety

builder.setContentSafety({
  restricted_categories: ['adult', 'tobacco', 'alcohol', 'sports_betting'],
  morals_clause: 'standard',
  competitor_exclusions: ['Brand X', 'Brand Y']
})
 
// Or use helpers
builder.addRestrictedCategory('alcohol')
builder.setMoralsClause('enhanced')
builder.addCompetitorExclusion('Nike')

Restricted categories:

  • adult - Adult content
  • gambling - Gambling/betting
  • tobacco - Tobacco products
  • alcohol - Alcoholic beverages
  • weapons - Weapons/firearms
  • politics - Political campaigns

Morals clause levels:

  • standard - Standard morals clause
  • enhanced - Enhanced conduct requirements
  • custom - Custom clause (requires text)

Building from Base License

Start with a base license and customize:

import { NILTaxonomyClient, NILLicenseBuilder } from '@nil-taxonomy/sdk';
 
// Fetch base license from API
const client = new NILTaxonomyClient({
  baseUrl: process.env.NIL_TAXONOMY_API_URL!,
  apiKey: process.env.NIL_TAXONOMY_API_KEY!,
});
 
const baseLicense = await client.getBaseLicense('NIL-COMM-STD', 'v1');
 
// Build from base
const customLicense = NILLicenseBuilder.fromBase(baseLicense)
  .setTerritoryCountries(['US'])
  .addRestrictedCategory('alcohol')
  .build();

fromBase() accepts a base license object. You must fetch the base license first using the client.

Validation

Use tryBuild() for safe building with validation:

const result = builder.tryBuild();
 
if (!result.success) {
  console.error('Build failed:', result.errors);
  result.errors.forEach(error => {
    console.error(`- ${error.field}: ${error.message}`);
  });
} else {
  console.log('✓ License built successfully');
  const license = result.license;
}

Chaining Methods

All builder methods return this for chaining:

const license = createCommercialLicense()
  .setTerritoryCountries(['US', 'CA'])
  .setTerm('2024-01-01', '2025-12-31', true, 'annual')
  .addRestrictedCategory('alcohol')
  .addRestrictedCategory('tobacco')
  .setAISyntheticUse('limited_depiction_only')
  .setDataUseLevel('aggregated_anon', false)
  .setAttribution('name_required')
  .setSublicensing('prohibited')
  .build();

TypeScript Support

Full type safety with IntelliSense:

import type { LicenseConfig, SubjectScope, UseType } from '@nil-taxonomy/sdk';
 
const license: LicenseConfig = builder.build();
 
// Type-safe dimension values
const scopes: SubjectScope[] = ['name', 'image']; // ✓ Valid
const invalid: SubjectScope = 'invalid'; // ✗ Type error

Examples

See SDK Examples for complete real-world examples.

Next Steps