@licenso/manager
v1.2.0
Published
License issuer (creates signed tokens) using Ed25519.
Downloads
30
Readme
@licenso/manager
License issuer (creates signed tokens) using Ed25519.
Install
pnpm add @licenso/managerUsage
import { createLicense } from '@licenso/manager';
const token = await createLicense(
{
deviceIdentifier: 'device-uuid',
usageLimits: { users: 25, resources: 1000 },
modules: { sso: true, billing: false },
},
{
privateKeyBytes, // Uint8Array (32 bytes) Ed25519 private key
lifetimeSeconds: 60 * 60 * 24 * 30, // 30 days
}
);API
export type CreateLicenseOptions = {
privateKeyBytes: Uint8Array;
lifetimeSeconds: number;
};
export async function createLicense(config: LicenseConfig, options: CreateLicenseOptions): Promise<string>;See @licenso/core for LicenseConfig types.
Build & test
pnpm nx build @licenso/manager
pnpm nx test @licenso/manager