Skip to main content
Each of these wraps a hook you could call yourself - use them when you just need to show/hide UI, reach for the hook directly when you need the loading/error state too.

Auth guards

Billing guards

Pass requested to check a quantity before it’s consumed, not just whether the feature is on. A QUOTA feature with 3 units left still passes a plain <Access> (something remains), but fails requested={5} up front - useful to block a batch action before the user commits to it instead of after a partial consume() fails mid-way:
There’s no plan-slug guard on purpose - matching on a plan name breaks silently the moment you rename a plan, or a customer ends up on an equivalent plan under a different slug. Access always checks the actual entitlement instead, so the check keeps working no matter how the plan behind it is restructured.
<Access> (via useAccess) is a live per-feature check and is what you gate on. useEntitlements() is a cached list for display - it has no per-feature allowed field, so a QUOTA verdict read from it can be stale. Render meters and “what’s included” from useEntitlements(); decide whether an action may run with useAccess / <Access>.

Combined guard

Error boundary

error.code is available when the thrown error came from an API call (a KerneError from @kerne/server) - not guaranteed for arbitrary React errors caught by the boundary.