Skip to content
BENIBIX Learn

Feature Flag

Development☁️ DevOps & CloudDeployment

Also known as Feature Toggle, Feature Switch, Flag

A switch in your code. It turns a feature on or off with no deploy.

Think of it like

Think of it like a light switch on the wall. The wiring is already in, and you choose when to turn it on.

Example

Emma ships a new search page behind a flag. She turns it on for staff only, finds a bug, fixes it, and then turns it on for everyone.

Why it matters

It splits shipping code from turning it on. You can deploy any time and release when it suits you.

Definition

A feature flag is an on and off switch in your code that hides or shows a feature. The new code ships switched off. You can then turn it on for your team, then for 10 percent of users, then everyone. If it goes wrong, you flip it off in seconds. Old flags should be removed, or the code fills up with dead switches.

Example code

javascript
if (flags.isOn('new-search', user)) {
  showNewSearch();
} else {
  showOldSearch();
}
The same code serves both versions, and the flag decides who sees which.

Common mistake

Leaving flags in the code for years. Each one doubles the paths to test, so remove a flag once it is fully on.

Key takeaways

  1. 1
    Ship it off. Turn it on later.
  2. 2
    Pick who sees it. Staff, a share, everyone.
  3. 3
    Clean up. Remove old flags.

Compare

Learn it properly