Feature Flags
Flag types, variants, and default values
A feature flag controls runtime behavior. Each flag has a key, type, variants, and a default value.
Flag Key
A unique identifier using kebab-case:
Keys must match the pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$.
Flag Types
| Type | Example Values | Use Case |
|---|---|---|
| Boolean | true, false | Feature on/off |
| String | "variant-a", "blue" | A/B test variants, themes |
| Number | 100, 3.14 | Limits, timeouts, percentages |
| Object | {"theme": "dark", "maxItems": 10} | Complex configuration |
Variants
Named values the flag can return. Every flag has at least two variants:
Default Value
The value returned when:
- The flag is disabled
- No targeting rules match
- An error occurs during evaluation
Choose defaults that are safe. If your flag controls a new feature, default to the old behavior.
Enabled vs Disabled
Each flag has an enabled/disabled state per environment:
- Disabled: Always returns the default variant
- Enabled: Evaluates targeting rules, returns matching variant
This gives you a kill switch. Something wrong with the new checkout? Disable the flag. All users get the old checkout instantly.
Creating a Flag
- Navigate to your project in the dashboard
- Click Flags > Create Flag
- Enter the key and select a type
- Define your variants
- Set the default variant
The flag is created disabled. Configure targeting rules, then enable it when ready.