Reference
Objects
The User and Permit objects the client answers with, field by field.
The shapes in toolaby.d.ts. Dates are Date objects, in the background and in a page alike; amounts are in minor units of their currency; ids are as the dashboard shows them.
User
Returned by getUser() and refresh().
| Field | Type | |
|---|---|---|
paid | boolean | Holds the tool by any means below. |
via | 'subscription' | 'licence' | 'trial' | 'grant' | 'account' | 'unknown' | null | How. account when the Wall has confirmed the account holds it but not yet by what. null when unpaid. |
email | string | null | The signed-in account's address, else the licence's. |
paidAt | Date | null | When the entitlement began. |
plan | Plan | null | The plan held, as Pricing defines it. |
subscription | { status, periodEnd, cancelAtPeriodEnd, cancelAt } | null | Stripe's status (active, trialing, past_due…), when the period ends, and whether it is set to end there. |
trial | { endsAt: Date | null, active: boolean } | null | A trial, when one is running or ran. |
deviceLimit | { allowed: number, held: number | null } | null | The account holds a plan, and this device is past its device limit: the plan unlocks allowed devices at once, and held hold it. The device has the Free plan until the buyer signs another one out on the account page. null otherwise. |
account | { linked, email, name, image, linkedAt } | The account signed in on this device, if any. name and image are what the account carries — Google's, when they signed in with it — from the server's last word; null until then. The account bar shows the picture, else the initial. |
licenseKey | { present: boolean } | A licence key was activated on this device. |
token | { issuedAt, expiresAt, offlineUntil } | null | The entitlement token's dates, epoch seconds. offlineUntil is how long it is honoured without the Wall. |
access | Access | What the Free plan holds. |
signInRequired | boolean | Whether using the tool needs an account at all. Signed out, gate() refuses with sign_in whatever the Free plan holds. |
features | string[] | null | The feature keys this device holds. null means everything: the tool has no features, or the entitlement lists none. |
usage | { unlimited, used, limit, remaining } | Free uses on this device. remaining is null when nothing is counted. |
version | VersionState | Whether this build may run. |
installedAt | Date | null | When the extension was first run on this device. |
installId | string | null | The device's id, as listed under Devices on the account page. |
billing | 'one_time' | 'subscription' | The tool's billing as configured. |
tool | string | The tool's id. |
Permit
Returned by gate(). One of three shapes; check allowed first.
Allowed
| Field | Type | |
|---|---|---|
allowed | true | |
isPremium | boolean | A paid plan, trial or grant is behind the answer. false when a free use was spent. |
unlimited | boolean? | Nothing is counted: a paid plan, or a Free plan set to everything or sign-in. |
remaining limit used | number? | The meter after this use, when the Free plan counts. |
deviceLimit | { allowed, held }? | The account holds a plan, but this device is past its device limit: the answer is the Free plan's. |
offline | boolean? | Answered from the device; the Wall was unreachable. |
Refused
| Field | Type | |
|---|---|---|
allowed | false | |
reason | 'sign_in' | 'paid' | 'limit' | 'feature' | 'count' | 'refused' | Sign-in required; a plan required; free uses spent; the plan does not hold the feature; a count that is not a whole number from 1 to 1000; the Wall refused the request; or an answer allowed a paid use without a token signed for this device that holds the feature, or a free use the Free plan the device knows does not give. |
feature needs | string? string[]? | For feature: the key asked for, and the ids of the plans that hold it. Pass one to openPaymentPage(). |
remaining limit | number? | For limit. |
deviceLimit | { allowed, held }? | The account holds a plan, but this device is past its device limit. showPaywall() says so, instead of the plans. |
isPremium offline | boolean? | As above. |
Blocked
| Field | Type | |
|---|---|---|
allowed | false | |
blocked | true | The build is below the minimum version, or on the refused list. |
message | string | null | Your message from Versions. |
Plan
| Field | Type | |
|---|---|---|
id | string | As under Pricing. What openPaymentPage() takes. |
name | string | |
billing | 'one_time' | 'subscription' | |
amountCents currency | number | null string | null | The price, in minor units. |
interval | 'month' | 'year' | null | Subscriptions. |
Access
What the Free plan holds, as set under Pricing.
| Value | |
|---|---|
open | Everything, for anyone. |
free_uses | A number of uses per device, then a plan. |
paid | Nothing without a plan. gate() refuses with paid. |
VersionState
| Field | Type | |
|---|---|---|
checked | boolean | The Wall has been asked about this build. The answer is kept across the worker's restarts until the next check. |
blocked | boolean | This build is below the minimum. |
reason | 'too_old' | 'denylisted' | null | |
message | string | null | Your message from Versions. |