# Node.js license client

No dependencies — uses Node's built-in `crypto`, `http`/`https`, and `fs`.

```js
const { LicenseClient } = require('./licenseClient');

const client = new LicenseClient({
  baseUrl: 'https://YOUR-SERVER',
  product: 'your-product-slug',
  publicKeyB64: 'PASTE_SIGNING_PUBLIC_KEY_FROM_/docs_HERE',
});

const result = await client.check(licenseKey);
if (result.valid) {
  console.log('licensed, status:', result.status, 'expires:', result.expiresAt);
} else {
  console.log('not licensed:', result.reason);
}
```

See `example.js` for a runnable script, and the `/docs` page on your server
for the full protocol reference.

`check()` calls `/api/v1/verify` first, and transparently falls back to
`/api/v1/activate` the first time a key is used on a device. Every response
is Ed25519-verified locally before being trusted or cached. If the server is
unreachable, the last-known-good signed response is used for up to 72h
(`fromOfflineCache: true` on the result) before failing closed.

If your own project has `"type": "module"` in its package.json, either
rename `licenseClient.js` to `licenseClient.cjs` or wrap the `require()` in
`createRequire()` — this file is plain CommonJS.
