Skip to main content
These act on the signed-in user’s own customer, so there’s no customer parameter.

Check access

useAccess(featureKey, requested?) returns { allowed, details, isLoading, error }. details is the full check result, from the same request:
Pass requested to ask whether that many more units are available: useAccess('api_calls', 5).
When a quota’s overage is billed or allowed, remaining goes negative while allowed stays true. Check details.overage_behavior before showing “limit reached”.

Access guard

There’s no guard on a plan name: gate on the feature, so renaming or restructuring a plan doesn’t break it.

List entitlements

For a “your plan” screen. Entries have no allowed field and can be up to 60 seconds old: gate with useAccess().

Read usage

The raw counter. For limit and remaining, use useAccess().

Record usage

These run in the browser, where the user can skip them. For usage you bill or enforce, call consume() from your backend.

Check on demand

useAccess() checks when the component mounts. To check on a click instead, use the client:
client.allows() returns false for a denial and throws on a real error, such as a 401 or a 500.