features map.
How It Works
When you callcanAccess:
- Crovver looks up the tenant’s active subscription
- Fetches the associated plan
- Checks
plan.features[featureKey] === true - Returns
canAccess: trueorfalse
canAccess: false.
Subscription in past_due → canAccess: false.
Subscription in trial → canAccess: true (trial counts as active).
Checking Access — Frontend
Use theuseFeatureAccess hook:
Checking Access — API
Blocking UI with FeatureGuard
The<FeatureGuard> component handles the gate declaratively:
Metered / Credit-Based Limits
Entitlements handle boolean feature access. For consumable resources (API calls, AI tokens, SMS credits), use the credit pool system instead:- Check balance before the action —
GET /api/public/credits/balance - Consume credits after the action —
POST /api/credits/consume(idempotent)