Feature flag

A feature flag is a switch in the code that turns a feature on or off for some or all users without deploying new code.
Automation
Created on
30.09.2026

Summarize this

What is a feature flag?

A feature flag (also called a feature toggle) is a conditional in the code that decides whether a feature is visible or active. The team can change its value from a dashboard or a config file, without shipping a new version. A feature can therefore be deployed to production while staying hidden until the team is ready to release it.

The idea separates two moments that used to be tied together: deploying code and releasing a feature to users. That separation reduces risk and makes releases much calmer.

‍

How a feature flag works

The application asks a flag service, or reads a config value, whether a feature is enabled for the current user. The answer decides which code path runs.

if (flags.isEnabled('new-checkout', user)) {
  renderNewCheckout();
} else {
  renderOldCheckout();
}

Flags can be evaluated on the server or in the browser, and their value can depend on the user, the country, the plan or a random percentage of traffic.

‍

Types of feature flags

  • Release flags: hide unfinished work and allow gradual rollouts.
  • Experiment flags: split traffic between variants for A/B tests.
  • Ops flags: act as a kill switch to disable a heavy or failing feature quickly.
  • Permission flags: reserve a feature for a plan, a beta group or internal users.

‍

Feature flag vs branch vs config

ApproachWhen the change appliesMain drawback
Feature flagAt runtime, instantlyAdds conditional code to maintain
Long-lived branchAt merge and deployPainful merges and late feedback
Static configAt the next restart or deployNo targeting per user

‍

Best practices and pitfalls

  • Give each flag a clear name, an owner and an expected removal date.
  • Remove a flag as soon as the feature is fully released, otherwise it becomes technical debt.
  • Keep the number of active flags low and test both the on and off paths.
  • Default to the safe state if the flag service does not respond.
  • Log which flag values a user saw, to make bugs reproducible.

‍

Feature flag at BeBranded

Flags fit naturally into automated workflows: a webhook can flip a flag, and a rollout can be staged without a new deployment. Through our automation services, our team connects flags, alerts and release steps so that launches stay controlled and easy to reverse.

FAQ

A feature flag is a conditional switch in the code that enables or disables a feature at runtime, without a new deployment.
Deploying puts code in production. Releasing makes a feature available to users. Feature flags let a team deploy first and release later.
They are used for gradual rollouts, A/B tests, beta programs, and kill switches that disable a failing feature instantly.
Yes. Feature flag, feature toggle and feature switch are different names for the same technique.
Old flags pile up, add complexity and multiply the code paths to test. Each flag needs an owner and a removal date.
Enable the flag for a small percentage of users, watch errors and metrics, then increase the percentage step by step until everyone has it.

Ready to boost your conversions?

Our team is here to understand your needs & work with you to create your next projects.
Get news, infos and resources.
Actionable tips delivered straight to your inbox.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.