Skip to content

ActivationClient

Defined in: index.ts:130

TTier extends string

TLimit

new ActivationClient<TTier, TLimit>(options): ActivationClient<TTier, TLimit>

Defined in: index.ts:140

ActivationClientOptions<TTier, TLimit>

ActivationClient<TTier, TLimit>

activate(code): Promise<ActivateResponse>

Defined in: index.ts:205

string

Promise<ActivateResponse>


checkActivation(): Promise<boolean | undefined>

Defined in: index.ts:226

Check with the server whether this device’s activation is still valid. Returns true = valid, false = invalidated (local state cleared), undefined = no local activation record.

When it reports “device not activated”, it first reactivates using the stored code+fingerprint (seat-decay self-healing); local state is only cleared on an explicit rejection (reactivation also rejected) — network failures or 5xx are expected transient states, always thrown, and errors never trigger a clear.

Promise<boolean | undefined>


getPlan(): Promise<Plan<TTier, TLimit>>

Defined in: index.ts:187

Read and resolve the current plan fresh from storage. Always reflects persisted state, no stale cache. If options.override() returns a valid tier, it takes precedence over the real activation record — not persisted, re-asked every time.

Promise<Plan<TTier, TLimit>>


getSnapshot(): Plan<TTier, TLimit>

Defined in: index.ts:162

Synchronous snapshot of the current plan, for render layers like useSyncExternalStore. Returns free until loaded; the reference stays stable while the tier is unchanged. Business decisions (e.g. limit checks mid-task) should use the live getPlan().

Plan<TTier, TLimit>


subscribe(listener): () => void

Defined in: index.ts:171

Subscribe to changes to the effective tier. This context’s own activation/revocation and changes broadcast from other contexts via transport share one channel; the first subscriber triggers an initial load.

PlanListener<TTier, TLimit>

() => void