Feature Flags
Release toggles, multiple variants and remote config, decided at the Coframe Edge and read through the Coframe SDK
Copy this guide and your current settings as a prompt for your AI agent.
Preview agent promptSee the guide, code and settings included when you copy.
Every Coframe project can ship feature flags, percentage rollouts, A/B/n variants and JSON remote config. You define a flag in the dashboard, Coframe publishes it to the Edge in the same save, and your site or server asks the Edge “what should this user get?” on each page view or request. The answer comes back in tens of milliseconds and never blocks the page. Turning a feature on or changing a setting no longer needs a deploy.
01Three kinds of flag
Choose the kind by the answer your code needs: yes or no, which version, or which settings.
| Kind | What it answers | Typical use |
|---|---|---|
| Release toggle (boolean) | On or off for this user, with an optional JSON payload when on | Gate a new checkout, ramp a feature to 10 % of users, turn a feature off in an emergency |
| Multiple variants (A/B/n) | Which variant this user gets, such as control or compact, each with its own payload |
Serve two or more versions of a layout, copy or configuration with a fixed split |
| Remote config | Always on; returns one JSON payload to everyone | Navigation, banners, thresholds, copy: anything you want to change without a deploy |
02What you get with it
- Targeting. Each toggle or variant flag has up to 20 condition sets. A set combines visitor properties (country, device, language, platform, first-time or returning, current URL, query string, your own user properties) with a rollout percentage.
- Stable buckets. Rollouts and splits hash the visitor’s user token with a per-flag seed, so the same person gets the same answer on every request and every Edge location. Widening a rollout never flips anyone out. See Rollouts and bucketing.
- Public and private. Browsers read public flags with just the project ID. Servers with a server API key also read private flags, which never reach a browser. See Public and private.
- One save publishes. Create, save and delete each rebuild the project’s whole snapshot at the Edge. There is no separate publish step.
- Any stack.
@coframe/sdkhas browser, React and server entry points, and any language can call the HTTP endpoint directly.
03Where to start
Create a flag
The dashboard, step by step, plus server API keys.
Browser and React
Read public flags from the SDK and the React hooks.
Server and SSR
Evaluate public and private flags with a server key, or call the endpoint from any language.
Reference
Limits, response reasons and what flags do not do yet.
A good first flag is a remote config with a small JSON payload: read it with
getRemoteConfig on one page, then move to a toggle with a 10 % rollout.
# Feature Flags Release toggles, multiple variants and remote config, decided at the Coframe Edge and read through the Coframe SDK Every Coframe project can ship feature flags, percentage rollouts, A/B/n variants and JSON remote config. You define a flag in the dashboard, Coframe publishes it to the Edge in the same save, and your site or server asks the Edge “what should this user get?” on each page view or request. The answer comes back in tens of milliseconds and never blocks the page. Turning a feature on or changing a setting no longer needs a deploy. [Video: Video: the three kinds of flag, reading each one in code, and public versus private flags (95s, narrated)](assets/videos/fig16-feature-flags.mp4) Watch: 95s — the three kinds of flag, reading each one in code, and public versus private flags Not the same as Feature Flag Control The SDK option `waitForFeatureFlag` and the `featureFlagSet` command let you gate the Coframe SDK behind your own flag system. This section is about Coframe’s own feature flags product. See [SDK Options — Feature Flag Control](../docs/sdk-options.html#feature-flag-control) for the former. ## Three kinds of flag Choose the kind by the answer your code needs: yes or no, which version, or which settings. Kind | What it answers | Typical use | Release toggle (boolean) | On or off for this user, with an optional JSON payload when on | Gate a new checkout, ramp a feature to 10 % of users, turn a feature off in an emergency | Multiple variants (A/B/n) | Which variant this user gets, such as `control` or `compact`, each with its own payload | Serve two or more versions of a layout, copy or configuration with a fixed split | Remote config | Always on; returns one JSON payload to everyone | Navigation, banners, thresholds, copy: anything you want to change without a deploy | ## What you get with it - Targeting. Each toggle or variant flag has up to 20 condition sets. A set combines visitor properties (country, device, language, platform, first-time or returning, current URL, query string, your own user properties) with a rollout percentage. - Stable buckets. Rollouts and splits hash the visitor’s user token with a per-flag seed, so the same person gets the same answer on every request and every Edge location. Widening a rollout never flips anyone out. See [Rollouts and bucketing](../docs/rollouts-and-bucketing.html). - Public and private. Browsers read public flags with just the project ID. Servers with a server API key also read private flags, which never reach a browser. See [Public and private](../docs/public-and-private.html). - One save publishes. Create, save and delete each rebuild the project’s whole snapshot at the Edge. There is no separate publish step. - Any stack. `@coframe/sdk` has browser, React and server entry points, and any language can call the HTTP endpoint directly. ## Where to start [Create a flagThe dashboard, step by step, plus server API keys.](../docs/creating-flags.html)[Browser and ReactRead public flags from the SDK and the React hooks.](../docs/browser-sdk.html)[Server and SSREvaluate public and private flags with a server key, or call the endpoint from any language.](../docs/server-sdk.html)[ReferenceLimits, response reasons and what flags do not do yet.](../docs/feature-flags-reference.html) A good first flag is a remote config with a small JSON payload: read it with `getRemoteConfig` on one page, then move to a toggle with a 10 % rollout.