Skip to main content

Feature Flags

Feature Flags enable you to change your application's behavior from within the GrowthBook UI. For example, turn on/off a sales banner or change the title of your pricing page.

You can set a global value for everyone, use advanced targeting to assign values to users, and run experiments to see which value is better.

Feature flags aren't limited to front-end changes. Use them on your back-end to gradually release a new ML model or enable new fields in an API response.

Why use Feature Flags?

Feature flags are a powerful tool for decoupling code deploys from feature releases. This enables you to release code more frequently and with less risk. It also enables you to do things like easily launch any new feature to a specific subset of users (like beta users), gradually roll out a new features, or turn any feature into an A/B test (experiment).

How to get started with Feature Flags?

  1. Create an SDK Connection in GrowthBook
  2. See Feature Flag Basics to learn the fundamentals and see the types of features we support (boolean, number, string, JSON)
  3. Learn about Targeting to target features to users with certain attributes
  4. Add Override Rules to target users with a Forced Value, rollout your feature to a percentage of users, or run an experiment
  5. Learn about Scheduling features and different feature Environments

SDK Connections

In order to use feature flags in your application, you need to create an SDK Connection in GrowthBook.

At a high level, the SDK Connection generates a unique clientKey which grants read-only access to feature flags in a specific environment. The SDKs use this to fetch feature flag states and override rules from the GrowthBook API.

On GrowthBook Cloud, we have a global CDN in front of the API (https://cdn.growthbook.io) to ensure low latency responses from anywhere in the world. The CDN has a 30-second TTL, so changes to a feature may take a little time to be reflected.

GrowthBook Proxy

We also offer a pre-built proxy server you can deploy on your own infrastructure. This can be put in front of either GrowthBook Cloud or a self-hosted GrowthBook instance.

The GrowthBook Proxy offers the following benefits:

  • Fast - Requests served from an in-memory cache close to your app servers
  • Scalable - A single Proxy server can handle over 10,000 reqs/second. Horizontally scale for more
  • Responsive - Changes in GrowthBook are rolled out to users in under a second

You can read more about the GrowthBook Proxy here.