Skip to content

Commit 673f95a

Browse files
bloveclaude
andauthored
docs(licensing): fix LicenseTier values, document EvaluateResult, correct runLicenseCheck idempotency (#609)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c2d2651 commit 673f95a

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

apps/website/content/docs/licensing/getting-started/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A token is:
3131
The payload must match `LicenseClaims`:
3232

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

3636
interface LicenseClaims {
3737
sub: string;

apps/website/content/docs/licensing/guides/setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323

2424
const status = await runLicenseCheck({
2525
package: '@threadplane/example',
26-
token: process.env.THREADPLANE_LICENSE,
26+
token: process.env['THREADPLANE_LICENSE'],
2727
publicKey: LICENSE_PUBLIC_KEY,
2828
isNoncommercial: inferNoncommercial(),
2929
});

apps/website/content/docs/licensing/reference/api.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This page documents the public exports from `@threadplane/licensing`.
55
## Types
66

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

1010
interface LicenseClaims {
1111
sub: string;
@@ -34,6 +34,14 @@ type LicenseStatus =
3434
| 'noncommercial';
3535
```
3636

37+
```ts
38+
interface EvaluateResult {
39+
status: LicenseStatus;
40+
/** Populated when the token was valid (licensed / grace / expired). */
41+
claims?: LicenseClaims;
42+
}
43+
```
44+
3745
## verifyLicense()
3846

3947
```ts
@@ -98,7 +106,7 @@ Runs the full check:
98106
2. evaluates the license status;
99107
3. emits a warning when appropriate.
100108

101-
Repeated calls with the same package and token are treated as already handled and return `licensed`.
109+
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`).
102110

103111
## emitNag()
104112

0 commit comments

Comments
 (0)