Check an entitlement
Call the SDK before the work you want to gate:amount is how much the request will consume. remaining is null when the feature has no cap.
Read all entitlements
How answers are cached
Entitlement checks sit on your request path, so the SDKs answer from a local cache:
A stale answer is used for up to
staleTtlMs (default 24 hours). After that, the SDK falls back to onUnavailable.
Warm the cache
Prefetch the customers you expect to see, such as the ones active at deploy time, so the first request does not wait:snapshot() and restore it with restore() to warm a new process from a previous one.
Invalidate after a change
When you change a customer’s plan or grant them something, drop the cached answer so the next check is live:subscription.plan_change webhooks. Invalidate on those if you cache outside the SDK.
Grant access directly
To give a customer a feature or a higher limit outside their plan, add an entitlement grant:featureId is required. limit, reason, and expiresAt are optional. expiresAt must be in the future. Grants are invalidated in the SDK cache automatically when the API creates them.
Remove a grant with DELETE /v1/entitlement-grants/:grantId.
React
In a React app, wrap components with<Feature> to show or hide them by entitlement. See React SDK.