Licensing API
This page documents the public exports from @ngaf/licensing.
#Types
#verifyLicense()
Parses and verifies the compact token against an Ed25519 public key.
It does not check iat, exp, grace windows, or commercial context. It only answers whether the token shape and signature are valid.
Failure reasons:
| Reason | Meaning |
|---|---|
malformed | token format, base64url payload, JSON, or claim shape failed |
tampered | signature verification failed or threw |
#evaluateLicense()
Turns a verify result into a LicenseStatus.
verifyResult can be undefined when no token exists. In that case the result is noncommercial only when isNoncommercial is true; otherwise it is missing.
graceSec defaults to 14 days.
#runLicenseCheck()
Runs the full check:
- verifies the token when present;
- evaluates the license status;
- emits a warning when appropriate.
Repeated calls with the same package and token are treated as already handled and return licensed.
#emitNag()
Emits one warning per package/status pair. Silent statuses are licensed and noncommercial.
#inferNoncommercial()
Returns true when process.env.NODE_ENV exists and is not "production". Returns false for production and for browser-like environments without a process global.
#signLicense()
Signs claims with an Ed25519 private key and returns the compact token consumed by verifyLicense().