customer parameter here - the client always checks the currently authenticated user’s own customer, resolved from their own session.
This is the hook to gate on.
useEntitlements() returns a cached list with no per-feature allowed - use it for a “your plan” screen, not for a go/no-go decision.The hook
requested to check “can I use N more”:
details from the same hook. There is no second call to make and no flag to set: the endpoint always returns the full record, so allowed and details come from one request.
details.limit is what the plan includes, not where access stops. On a feature that bills or tolerates its overage, remaining runs down to zero and then goes negative while allowed stays true — the user hasn’t hit a wall, they’ve started paying. Read details.overage_behavior before rendering “you have reached your limit”, and clamp remaining before showing it.The guard component
<Access> wraps useAccess for declarative gating:
Lower-level: useClient().allows() / .check()
useAccess and <Access> call these internally on the underlying KerneClient - reach for them directly only if you need to trigger a check imperatively (e.g. on a button click, not on mount):
Why there’s no consume() here
Enforcing a quota only in the browser is trivially bypassed - commit usage from your backend with @kerne/server’s consume(), and use this SDK only to reflect the result.
