Feature flag system based on license tier.
Each feature is registered with a minimum required tier. Add new features here as they're built — no other code changes needed.
Usage
if Features.enabled?(:audit_log) do
# render audit log section
endAdding a new feature
Just add it to @features with the required tier:
@features %{
...
scheduled_toggles: :paid
}
Summary
Functions
Returns true if route count exceeds free tier limit.
Audit log retention in days.
Returns the integer cap or the total, whichever is smaller.
Returns a feature comparison matrix for the Plans modal.
Returns the current tier for display purposes.
Check if a feature is enabled for the current license tier.
Returns the license expiry date if set.
Max number of users allowed.
Max number of routes allowed. Returns :unlimited for paid.
Number of routes hidden beyond the cap.
Returns true if the license is in a trial period.
Functions
Returns true if route count exceeds free tier limit.
Audit log retention in days.
Returns the integer cap or the total, whichever is smaller.
Returns a feature comparison matrix for the Plans modal.
Each entry has:
:name— feature display name:free— what free tier gets:paid— what paid tier gets
Returns the current tier for display purposes.
Check if a feature is enabled for the current license tier.
Returns true if the feature's minimum tier is satisfied.
Examples
iex> Features.enabled?(:route_discovery)
true
iex> Features.enabled?(:nonexistent)
false
Returns the license expiry date if set.
Max number of users allowed.
Max number of routes allowed. Returns :unlimited for paid.
Number of routes hidden beyond the cap.
Returns true if the license is in a trial period.