Skip to main content

What are Feature Flags?

Feature flags let you turn features on or off remotely without deploying code. Think of them as light switches for your app’s functionality. Common uses:
  • Roll out features gradually
  • Enable features for specific users
  • Emergency kill switch for broken features
  • Testing in production safely

Simple Feature Flag

The most basic flag - on or off:
Set new_ui_enabled to 'true' in the dashboard to enable, 'false' to disable.

Gradual Rollout

Enable a feature for a percentage of users:
Dashboard setup:
  • Week 1: Enable for 5% of users
  • Week 2: Increase to 25%
  • Week 3: Increase to 50%
  • Week 4: Enable for everyone (100%)
Monitor metrics at each stage before expanding.

User-Specific Flags

Enable features for specific user groups:
In the dashboard, create a rule: if plan === 'premium', return 'true'. Free users see the upgrade prompt.

Multiple Flag Checks

Combine flags for complex logic:
Each feature controlled independently.

Emergency Kill Switch

Disable features instantly if issues arise:
If the chat service goes down, set chat_enabled to false in the dashboard. All users stop seeing it immediately - no code deployment needed.

Beta Program

Give early access to beta testers:
Dashboard rule: if beta_tester === 'true', return 'true'.

Feature Development Flow

Use flags throughout feature development: 1. Development: Feature hidden by default
2. Internal Testing: Enable for your team
3. Beta: Enable for beta users
4. Gradual Launch: Enable for increasing percentages 5. Full Release: Enable for everyone 6. Cleanup: Remove flag once stable (code becomes permanent)

Combining with Analytics

Track feature usage:
Measure engagement before full rollout.

Default Values

Always provide defaults:
Defaults ensure your app works even if the API is down.

Progressive Enhancement

Use flags to add enhancements progressively:
Add features incrementally based on user feedback and metrics.

Regional Features

Enable features in specific regions:
Dashboard rule: if country === 'US', return 'true'. Launch in one region first, expand globally later.

Best Practices

1. Descriptive Names: Use clear, specific flag names.
2. Document Flags: Add notes in your dashboard about what each flag controls and when to remove it. 3. Clean Up Old Flags: Remove flags once features are stable and fully rolled out. 4. Default to Safe: If unsure, default to 'false' (feature off). 5. Monitor Impact: Track metrics before and after enabling features.

Testing Feature Flags

Test both states in your code:
Ensure your app works correctly whether the flag is on or off.

Next Steps

Remote Config

Master configuration management

A/B Testing

Test features with A/B tests

Personalization

Customize per user