Toolaby
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().

FieldType
paidbooleanHolds the tool by any means below.
via'subscription' | 'licence' | 'trial' | 'grant' | 'account' | 'unknown' | nullHow. account when Toolaby has confirmed the account holds it but not yet by what. null when unpaid.
emailstring | nullThe signed-in account's address, else the licence's.
paidAtDate | nullWhen the entitlement began.
planPlan | nullThe plan held, as Pricing defines it.
subscription{ status, periodEnd, cancelAtPeriodEnd, cancelAt } | nullStripe's status (active, trialing, past_due…), when the period ends, and whether it is set to end there.
trial{ endsAt: Date | null, active: boolean } | nullA trial, when one is running or ran.
deviceLimit{ allowed: number, held: number | null } | nullThe 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, plan } | nullThe entitlement token's dates, epoch seconds. offlineUntil is how long it is honoured without Toolaby. plan is the id of the plan the token was signed for, while it verifies; null for a trial or a grant, and while unpaid.
accessAccessWhat the Free plan holds.
signInRequiredbooleanWhether using the tool needs an account at all. Signed out, gate() refuses with sign_in whatever the Free plan holds.
featuresstring[] | nullThe feature keys this device holds. null means everything: the tool has no features, or the entitlement lists none.
usage{ unlimited, used, limit, remaining, per, resetsAt? }Free uses on this device, or, where the tool requires an account, the signed-in account's. remaining is null when nothing is counted. per is 'ever' when they are counted in total, or 'day', 'week' or 'month' when they start again (UTC), with resetsAt, a Date, when more come.
versionVersionStateWhether this build may run.
installedAtDate | nullWhen the extension was first run on this device.
installIdstring | nullThe device's id, as listed under Devices on the account page.
billing'one_time' | 'subscription'The tool's billing as configured.
toolstringThe tool's id.

Permit

Returned by gate(). One of three shapes; check allowed first.

Allowed

FieldType
allowedtrue
isPremiumbooleanA paid plan, trial or grant is behind the answer. false when a free use was spent.
unlimitedboolean?Nothing is counted: a paid plan, or a Free plan set to Everything free.
remaining limit usednumber?The meter after this use, when the Free plan counts.
per resetsAtstring? Date?When free uses start again each day, week or month: the period, and when more come. Not in an answer given offline.
deviceLimit{ allowed, held }?The account holds a plan, but this device is past its device limit: the answer is the Free plan's.
sharedUsestrue?A free use counted with every throwaway or unverified address of the tool: they share one count, as they have no trial.
offlineboolean?Answered from the device; Toolaby was unreachable.

Refused

FieldType
allowedfalse
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; Toolaby 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 needsstring? string[]?For feature: the key asked for, and the ids of the plans that hold it. Pass one to openPaymentPage().
remaining limitnumber?For limit.
per resetsAtstring? Date?For limit, when free uses start again each day, week or month: the period, and when more come. Not in a refusal given offline.
deviceLimit{ allowed, held }?The account holds a plan, but this device is past its device limit. showPaywall() says so, instead of the plans.
sharedUsestrue?For limit: the free uses spent were the ones every throwaway or unverified address of the tool shares. They start again with the tool's period, or the next day (UTC) where the uses are counted in total. showPaywall() says why.
isPremium offlineboolean?As above.

Blocked

FieldType
allowedfalse
blockedtrueThe build is below the minimum version, or on the refused list.
messagestring | nullYour message from Versions.

Plan

FieldType
idstringAs each plan's card under Pricing shows it. What openPaymentPage() takes.
namestring
billing'one_time' | 'subscription'
amountCents currencynumber | null string | nullThe price, in minor units.
interval'month' | 'year' | nullSubscriptions.

Access

What the Free plan holds, as set under Pricing.

Value
openEverything, for anyone.
free_usesA number of uses per device (per account where the tool requires one), then a plan.
paidNothing without a plan. gate() refuses with paid.

VersionState

FieldType
checkedbooleanToolaby has been asked about this build. The answer is kept across the worker's restarts until the next check.
blockedbooleanThis build is below the minimum.
reason'too_old' | 'denylisted' | null
messagestring | nullYour message from Versions.

On this page