@themodcraft/license-client
v1.2.2
Published
License resolution and entitlement checks for the package suite.
Readme
@themodcraft/license-client
License resolution and entitlement checks for the package suite.
Includes:
- License key parsing and snapshot resolution
- React provider helpers
- Entitlement gating utilities
Install:
npm install @themodcraft/license-clientThis package publishes compiled output only.
Package and product entitlements
TMC_ENTITLEMENTS is the stable registry for Nexus package licenses. Account APIs may also return arbitrary product entitlement strings without adding every product to that registry.
import {
TmcLicenseProvider,
useTmcEntitlement,
type LicenseSnapshot,
} from "@themodcraft/license-client";
const accountSnapshot: LicenseSnapshot = {
entitlements: ["pro-kit", "product:tmc-oxide"],
status: "active",
};
function ProductDownload() {
const access = useTmcEntitlement("product:tmc-oxide");
return access.allowed ? <DownloadButton /> : null;
}
<TmcLicenseProvider initialSnapshot={accountSnapshot}>
<ProductDownload />
</TmcLicenseProvider>;LicenseSnapshot remains the shared remote-resolution shape for downloadable software. createTmcLocalLicenseKey and its unsigned encoding are development helpers only; they must never be treated as purchase or entitlement proof.
