Setup
Most applications do not import @ngaf/licensing directly. Framework packages call runLicenseCheck() from their providers when you pass a license token.
For example, higher-level packages expose a license option:
When no token is supplied, the licensing helper can evaluate the environment as noncommercial when the package passes isNoncommercial: true.
#Direct use
Use the direct API when you are building a package inside the framework or a custom integration that needs the same behavior.
runLicenseCheck() returns the evaluated LicenseStatus.
#Warnings
emitNag() is silent for:
licensed;noncommercial.
It warns once per package and status for:
missing;grace;expired;tampered.
The warning prefix is [threadplane], and the package keeps running.
You can inject a custom warning sink:
#Noncommercial hint
inferNoncommercial() checks globalThis.process?.env.NODE_ENV.
It returns:
truewhenNODE_ENVexists and is anything other than"production";falsewhenNODE_ENVis"production";falsewhen there is noprocessglobal.
This is only a default hint. Callers can pass isNoncommercial explicitly.
#Gotchas
runLicenseCheck() is idempotent for identical package and token values. A repeated call with the same key returns licensed without re-running the check.
That keeps repeated provider initialization quiet, but it means package authors should not use repeated calls with identical inputs as a status polling mechanism.
verifyLicense() does not check time. Pair it with evaluateLicense() when you need expiration and grace behavior.