UseCanResult
Result of useCan — the entitlement check reduced to the shape a can
question actually needs.
Properties
Section titled “Properties”can:
boolean
true when the user may proceed — the evaluator’s verdict, i.e. not
denied. A limited result still grants access when the evaluator allows
it (degrade mode / running low), but an at-cap limit whose enforcement
blocks — including the unset-enforcement default — resolves limited with
allowed: false and can is false. Deny-until-ready, matching the
SDK’s fail-closed contract: can is false until the check resolves, and
stays false if the check errors. Evaluation is local to the loaded
Playbook (no per-check network call), so the unresolved window is one
microtask once initialization completes; in hosted mode the first load
spans the initial config fetch. Gate paywall UI on !can && !isLoading so
entitled users never see an upsell flash; never gate on !allowed (that
would also block limited users who are still entitled).
isLoading
Section titled “isLoading”isLoading:
boolean
true until the entitlement check first resolves (including while the SDK
initializes), and again while a recheck is in flight. Settles to false
once a result — or an error — has landed. Pair with can:
!can && isLoading is “still deciding”; !can && !isLoading is a settled
deny.
limited
Section titled “limited”limited:
boolean
true when access is granted but the balance is approaching its limit (the
“running low” state). Surface a soft warning while still allowing the action.
result
Section titled “result”result: { } |
null
The full entitlement result (status, reason, current_tier, placement,
…), or null until the check resolves — the escape hatch for details beyond
can / limited.