productSlug option and an optional remote API check.
Usage
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
feature | string | — | Feature key to check. Optional when productSlug is provided — omitting it performs a subscription-existence check. |
opts.checkRemote | boolean | false | Check via API instead of local plan data. Required when using productSlug. |
opts.productSlug | string | — | Scope the check to a specific product. Overrides the provider-level productSlug for this call. |
Return Value
How Access Is Determined
By default this is a local check — no API call is made. The subscription data fetched byCrovverProvider on mount is used:
- No active subscription →
hasAccess: false - Feature not in
plan.features→hasAccess: false plan.features[featureKey] === true→hasAccess: true
checkRemote: true, the hook calls POST /api/public/can-access on every render cycle change, which supports productSlug scoping.