Feature flags
Runtime toggles for off/on variants, typed payloads, rollout percentages, targeting, and source-experiment promotion.
Simple terms
Feature flags are controlled switches or payloads for engineering rollouts, not visual A/B test DOM changes.
Runtime toggles for off/on variants, typed payloads, rollout percentages, targeting, and source-experiment promotion.
Routes
/flags
Implementation behavior
- Flags use the same targeting and rollout concepts as experiments but return a decision payload instead of DOM mutation behavior.
- A flag has status, key, rollout, targeting, variants, default/off value, and optional source experiment.
- Decision debugger explains why a visitor would receive a variant.
- Flags can be activated, paused, archived, or created from successful experiments.
How to use it
- Use flags when engineering needs a controlled rollout or remote configuration.
- Keep payloads typed and stable so application code can consume them safely.
- Test decisions with the debugger before activating.
- Archive flags that are permanently shipped in application code.
When not to use it
- Do not use a flag when you need experiment analytics and variant conversion tracking.
- Do not put secret or unsafe values in flag payloads consumed by the browser.
- Do not keep temporary rollout flags alive after the feature is permanently shipped.
Implementation source
- Pages live under
src/app/(dashboard)/flags. - Handlers live under
/api/flagsplus activate, pause, and archive routes. - Flags share targeting and rollout ideas with experiments but return typed decision payloads instead of DOM mutations.
Data and API
- Flag and flag variant models plus targeting JSON.
- APIs under
/api/flags,/api/flags/[id],/api/flags/[id]/activate,/api/flags/[id]/pause,/api/flags/[id]/archive, and experiment-to-flag creation. - Runtime decisions are delivered through configuration and flag evaluation endpoints.
Failure modes
- Application sees default value: flag paused, key mismatch, targeting miss, or rollout percentage excludes visitor.
- Bad payload breaks consuming app code: validate schema and defaults before activation.
- Old flags create confusion: archive retired rollouts.