Feature Flag
ELI5 — The Vibe Check
A feature flag is a toggle that lets you turn features on or off without deploying new code. Ship the code dark (hidden behind a flag), enable it for 5% of users, check if it's working, then roll it out to everyone. Bug found? Flip the flag off. No rollback, no revert, no emergency deploy. It decouples deployment from release — you can deploy on Friday and release on Monday.
Real Talk
Feature flags (feature toggles) are conditional code paths controlled by external configuration that allow teams to enable or disable features at runtime. Types include release flags (gradual rollouts), experiment flags (A/B tests), ops flags (kill switches), and permission flags (entitlements). Managed services include LaunchDarkly, Unleash, and Flagsmith. Implementation ranges from simple boolean checks to sophisticated user-targeting rules with percentage rollouts.
Show Me The Code
// Simple feature flag check
if (featureFlags.isEnabled('new-checkout', { userId: user.id })) {
return <NewCheckout />;
} else {
return <LegacyCheckout />;
}
// Gradual rollout config
{
"new-checkout": {
"enabled": true,
"rolloutPercentage": 25,
"targeting": {
"include": ["beta-users"],
"exclude": ["enterprise-tier"]
}
}
}
When You'll Hear This
"Ship it behind a feature flag — we can enable it for beta users first." / "Kill switch the payment feature if we see error rates spike."
Related Terms
A/B Testing
Showing half your users version A and half version B to see which one performs better. Blue button vs green button? Short headline vs long headline?
Canary Release
A canary release is like sending a canary into a coal mine — you deploy the new version to a tiny fraction of users first and watch closely.
Deployment
A deployment is the event of pushing your code live — it's both the action and the thing you deployed.
LaunchDarkly
LaunchDarkly is the king of feature flags as a service. Toggle features on/off for specific users, segments, or percentages without deploying.