app.name, for example photos.items or shout.posts.
The limit you read already includes the user’s plan and anything granted to them on top. Show it as you receive it. Never hard-code a number in your app: the same quota can be 100 for one user and 500 for another.
useQuota
Reads one quota by key.For a quota that applies to one container rather than the whole account, such as the items in one list, the container’s id.
How much is used and how much is left.
null when the quota is per container and you didn’t pass parentId.What the numbers count. Format bytes and seconds before showing them.
stock is what the user holds; deleting something frees room. period is what they use per day, week or month.For a
period quota, the ISO time it starts over. Daily quotas reset at the user’s own midnight. null for stock quotas.true when a paid plan would raise this limit. Use it to decide whether to mention upgrading. Mention it only where usePurchasesAvailable() is true: never inside the mobile app.useRefreshQuotas() after your app changes what a quota counts, and after a refusal.
useQuotas
useQuotas() returns { plan, quotas }: the user’s plan (free, plus or pro) and every quota your app can read. Use it for a usage screen.
Your app sees its own quotas and the pools that all apps share, such as AI credits. It never sees another app’s quotas. An app with no quotas of its own gets only the shared pools.
Handling a refusal
A request over a quota fails, and its body carries aquota object with code: 'QUOTA_EXCEEDED'. quotaExceeded(error) returns that object, or null for any other error. It has the same fields as useQuota, plus the key that refused.
Every quota refusal is a 403 with code: 'QUOTA_EXCEEDED'. Use quota.key to tell which quota refused.
Running out of AI credits answers 402 and is read with
aiCreditsExhausted, not quotaExceeded.
If you only need a sentence to show, quotaMessage(error) returns one in the user’s language (English or Turkish), or null for any other error. Put it in front of your usual failure message:
getQuota(key, options) and getQuotas().
Plan features
Some things a plan gives are not numbers but on or off: a badge, a custom domain, a screen. These are features.useFeature(key) tells you whether the signed-in user has one:
code: 'FEATURE_REQUIRED'; featureRequired(error) returns { key, upgradable, tiers }, or null for any other error.
useAccess() returns everything at once: the user’s plan (id, trial, until), every feature, and what each plan includes (plans), which is what you need to draw a plan comparison.
When a request is refused by a quota or feature that a paid plan would lift, the UI kit’s UIProvider shows one toast offering the plans. You don’t need to wire it; keep showing your own error message. To draw your own offer instead, pass upgradeOffers={false} and listen with onUpgradeOpportunity.