Birch UI v0.1
Pricing

@birchui/license

Offline license key verification and activation.

Open .md
npm install @birchui/licenseLicense: MIT

Key exports: setLicenseKey, verifyLicenseKey, checkLicense, decodeLicenseKey, LicensePayload

Guides: Licensing and activation

@birchui/license#

checkLicensefunction#

function checkLicense(product: ProductId, options: { key?: string; host?: HTMLElement; publicKey?: Uint8Array } = {}): LicenseHandle
ParameterTypeDescription
productProductId—
optionsoptional{ key?: string; host?: HTMLElement; publicKey?: Uint8Array }—

Defined in packages/license/src/check.ts:30

decodeLicenseKeyfunction#

function decodeLicenseKey(key: string): LicensePayload | null
ParameterTypeDescription
keystring—

Defined in packages/license/src/payload.ts:89

getLicenseKeyfunction#

function getLicenseKey(): string | undefined

Defined in packages/license/src/key-store.ts:11

licenseCoversfunction#

function licenseCovers(payload: LicensePayload, product: ProductId): boolean
ParameterTypeDescription
payloadLicensePayload—
productProductId—

Defined in packages/license/src/payload.ts:94

onLicenseKeyChangefunction#

function onLicenseKeyChange(listener: (key: string | undefined) => void): () => void
ParameterTypeDescription
listener(key: string | undefined) => void—

Defined in packages/license/src/key-store.ts:15

setLicenseKeyfunction#

function setLicenseKey(key: string | undefined): void
ParameterTypeDescription
keystring | undefined—

Defined in packages/license/src/key-store.ts:4

verifyLicenseKeyfunction#

function verifyLicenseKey(key: string | undefined, product: ProductId, options: { publicKey?: Uint8Array; now?: Date } = {}): Promise<LicenseCheck>
ParameterTypeDescription
keystring | undefined—
productProductId—
optionsoptional{ publicKey?: Uint8Array; now?: Date }—

Defined in packages/license/src/verify.ts:18

PRODUCT_NAMESconst#

const PRODUCT_NAMES: Record<ProductId, string>

Defined in packages/license/src/types.ts:38

PURCHASE_URLconst#

const PURCHASE_URL: string = 'https://birchui.com/pricing'

Defined in packages/license/src/types.ts:53

LicenseCheckinterface#

interface LicenseCheck
PropertyTypeDescription
statusLicenseStatus—
productProductId—
licenseoptionalLicensePayload—
messagestring—

Defined in packages/license/src/types.ts:31

LicenseHandleinterface#

interface LicenseHandle
PropertyTypeDescription
readyreadonlyPromise<LicenseCheck>—
currentreadonlyLicenseCheck | undefined—
dispose()() => void—

Defined in packages/license/src/check.ts:7

LicensePayloadinterface#

interface LicensePayload
PropertyTypeDescription
v1—
idstring—
tostring—
emailoptionalstring—
products(ProductId | '*')[]—
seatsnumber—
tierLicenseTier—
iatstring—
expoptionalstring—

Defined in packages/license/src/types.ts:17

LicenseStatustype#

type LicenseStatus = 'valid' | 'missing' | 'malformed' | 'bad-signature' | 'expired' | 'wrong-product';

Defined in packages/license/src/types.ts:29

LicenseTiertype#

type LicenseTier = 'developer' | 'team' | 'company' | 'oem' | 'trial';

Defined in packages/license/src/types.ts:15

ProductIdtype#

type ProductId =
  | 'grid-pro'
  | 'excel'
  | 'scheduler'
  | 'gantt'
  | 'calendar'
  | 'charts'
  | 'pivot-studio'
  | 'forms'
  | 'diagram'
  | 'spreadsheet'
  | 'pdf'
  | 'document';

Defined in packages/license/src/types.ts:1

@birchui/license/sign#

generateSigningKeyPairfunction#

function generateSigningKeyPair(): { privateKeyPem: string; publicKeyRaw: Uint8Array }

Defined in packages/license/src/sign.ts:32

newLicenseIdfunction#

function newLicenseId(): string

Defined in packages/license/src/sign.ts:40

signLicensefunction#

function signLicense(payload: Omit<LicensePayload, 'v'> & { v?: 1 }, privateKeyPem: string): string
ParameterTypeDescription
payloadOmit<LicensePayload, 'v'> & { v?: 1 }—
privateKeyPemstring—

Defined in packages/license/src/sign.ts:16

↑ ↓ to move, Enter to open, Esc to close