Entitlements
Entitlements Overview
Feature gating and usage limits
Entitlements control what customers can do based on their subscription plan.
Two types:
- Feature gates — boolean access (can this customer use analytics? yes/no)
- Usage limits — numeric caps (this customer can make 10,000 API calls/month)
How it works:
- Define features and assign them to plans (in the dashboard or via API)
- Check access at runtime using can() — in your API (Node/Python SDK) or UI (React useCan hook)
- Get real-time updates via WebSocket (React SDK auto-subscribes)
Server-side check:
const { allowed, remaining, limit, used } = await nozle.can('cust_123', 'api_calls');
if (!allowed) return res.status(403).json({ error: 'Upgrade required' });Client-side check:
const { allowed, loading } = useCan('cust_123', 'api_calls');
// Or use declarative gates:
<FeatureGate customerId="cust_123" feature="analytics" fallback={<UpgradePrompt />}>
<Dashboard />
</FeatureGate>What makes Nozle's entitlements powerful:
- Real-time WebSocket updates — no polling
- Low-latency cached counters for sub-millisecond checks
- Margin-aware responses (cost/revenue/margin per use)
- React SDK components (FeatureGate, UsageGate, PlanGate, LockedOverlay)