Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A token is:
The payload must match `LicenseClaims`:

```ts
type LicenseTier = 'developer-seat' | 'app-deployment' | 'enterprise';
type LicenseTier = 'developer_seat' | 'team' | 'enterprise';

interface LicenseClaims {
sub: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/website/content/docs/licensing/guides/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {

const status = await runLicenseCheck({
package: '@threadplane/example',
token: process.env.THREADPLANE_LICENSE,
token: process.env['THREADPLANE_LICENSE'],
publicKey: LICENSE_PUBLIC_KEY,
isNoncommercial: inferNoncommercial(),
});
Expand Down
12 changes: 10 additions & 2 deletions apps/website/content/docs/licensing/reference/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This page documents the public exports from `@threadplane/licensing`.
## Types

```ts
type LicenseTier = 'developer-seat' | 'app-deployment' | 'enterprise';
type LicenseTier = 'developer_seat' | 'team' | 'enterprise';

interface LicenseClaims {
sub: string;
Expand Down Expand Up @@ -34,6 +34,14 @@ type LicenseStatus =
| 'noncommercial';
```

```ts
interface EvaluateResult {
status: LicenseStatus;
/** Populated when the token was valid (licensed / grace / expired). */
claims?: LicenseClaims;
}
```

## verifyLicense()

```ts
Expand Down Expand Up @@ -98,7 +106,7 @@ Runs the full check:
2. evaluates the license status;
3. emits a warning when appropriate.

Repeated calls with the same package and token are treated as already handled and return `licensed`.
Repeated calls with the same package and token are treated as already handled and return the same status computed on the first call (idempotent; not necessarily `licensed`).

## emitNag()

Expand Down
Loading