Principle:Helicone Helicone Feature Gating
| Knowledge Sources | |
|---|---|
| Domains | Access Control, Subscription Management, Product |
| Last Updated | 2026-02-14 06:32 GMT |
Overview
Feature Gating is the practice of controlling access to platform features based on the user's subscription tier, with support for usage limits, trial periods, and upgrade prompts.
Description
A tiered SaaS product must conditionally enable or disable features based on what the customer has paid for. Feature gating provides a declarative system where each feature is associated with the minimum tier required to access it, optional usage limits (e.g., "100 requests per day on the free tier"), and trial eligibility. At runtime, the system checks the user's current tier against the feature requirements and returns an access decision: granted, denied (with upgrade prompt), trial available, or limit reached.
In Helicone, this is implemented through a set of React hooks that encapsulate the tier-checking logic: checking whether the user has access to a feature, whether a free trial is available, whether free-tier limits have been reached, and whether pro-tier features are unlocked. Feature definitions map feature identifiers to their tier requirements and limits.
Usage
Use feature gating when:
- Different subscription tiers offer different feature sets.
- Free-tier users need usage limits that upgrade tiers remove.
- Trial periods allow temporary access to premium features.
- UI components must conditionally render based on entitlements.
Theoretical Basis
Feature gating implements role-based access control (RBAC) where roles are subscription tiers and permissions are feature entitlements. The tier hierarchy forms a total order (free < pro < enterprise), so access checks are simple comparisons: the user's tier must be greater than or equal to the feature's required tier. Usage limits add a quota dimension, implementing a token bucket or counter-based rate limit per billing period. The declarative feature definition map follows the configuration-over-code principle, making it easy to adjust entitlements without changing application logic.