Feature flags
Shipped In the web app (Analytics → Feature flags), the REST API and the MCP server.
A feature flag turns something on for the visitors you pick, or splits them between versions so you can see which works better: a new headline on half your visitors, a banner only for people from one campaign, a new checkout for 10% of visitors first. Your website reads flags through Outflare’s tracking script, and your servers through the API. Both get the same answer for the same visitor.
Two kinds
Section titled “Two kinds”- A switch is on or off for each visitor.
- A split gives each visitor one of two to ten versions, by weight, such as
control50% andfaster50%. A version can carry content, such as{"headline": "Ship faster"}, so a page can show a new headline without a deploy.
A new flag is off until you turn it on. While it’s off, every visitor gets false, and your pages don’t even learn it exists.
Who gets it
Section titled “Who gets it”- Conditions. The page’s path, site, full address, a parameter of the address (such as
utm_source), where the visitor came from, their device (computer, phone, tablet) and browser language. Your servers can also say whether someone is signed in, and send their own properties, such as their plan. Every condition must hold. - People. A flag can be limited to the people in one of your lists, to a field of the person’s record (such as
planispro), or to named user ids. This is how you give a feature to staff and pilot customers only. A visitor Outflare doesn’t know yet isn’t in any list. - Signed in. Whether the visitor is signed in, from the signed-in hint your app sets.
- Rollout. Of the visitors who match, the share that gets the flag at all. Raising it only adds visitors: nobody loses it.
- Brand. A flag for one brand reaches only that brand’s site.
- Servers only. A flag can stay out of your pages entirely, for your servers alone.
Each visitor keeps their version
Section titled “Each visitor keeps their version”The version comes from the flag and the visitor’s own id, so the same visitor sees the same version on every page and every visit, and your servers agree with the page. Nothing extra is stored about them. Changing the split of a flag that’s on moves some visitors to another version, and the page warns you before you do. Changes reach visitors within 10 seconds.
Exclusion groups
Section titled “Exclusion groups”Two A/B tests running at once on the same pages can share visitors, and one change can alter the other’s effect. Put their flags in one exclusion group, such as homepage, to keep them apart. Each flag takes its share of the group’s visitors (half by default) and is off for everyone else in the group, so no visitor is in two of the group’s tests and each test measures its own change cleanly. Which share a visitor falls in comes from the group’s name and their id, so it’s the same on every page and server.
A group holds 100% of its visitors: a flag asking for more than is free is refused, and you can give it a smaller share or take a flag out. A flag’s group and share are fixed while its A/B test runs, since changing them would change who the test measures.
Holdouts
Section titled “Holdouts”A group can keep a share of its visitors, up to half, out of every flag in it: set its holdout under Exclusion groups on the Feature flags page. Those visitors see your site as it was wherever the group’s tests run. Over weeks, comparing them with everyone else shows what all the group’s changes did together, which single tests can’t: effects that add up, fade or cancel out. The holdout report counts a goal for every visitor to your site in the period you choose, and shows the lift of everyone else over the holdout.
On your website
Section titled “On your website”Add data-flags to your tracking script’s tag:
<script async src="https://app.outflare.ai/site.js" data-key="ofk_test_not_a_real_key" data-flags></script>Then use the visitor’s versions in a script:
<script> window.outflare = window.outflare || []; function onFlags(fn) { outflare.onFlags ? outflare.onFlags(fn) : outflare.push(["onFlags", fn]); }
onFlags(function (flags) { if (flags["pricing-headline"] === "faster") { document.querySelector("h1").textContent = outflare.flagPayload("pricing-headline").headline; } });</script>outflare.onFlags(fn)runs once the visitor’s flags are known.outflare.flag("pricing-headline")gives the version, orfalse.outflare.flagPayload("pricing-headline")gives the version’s content.
Or in CSS alone: the page gets a class for each version the visitor has, such as of-flag-pricing-headline-faster.
To see which version wins, run an A/B test on the flag. A page that reads a flag (or, with data-flags, shows its class) tells Outflare once per visit, so the test counts that visitor.
No flicker
Section titled “No flicker”The script loads without holding up your page, so the original can show for a moment before a version replaces it. There are two ways to prevent that.
Decide on your server (best). Your server asks for the visitor’s flags (below), renders their version, and hands the same answer to the page in a tag the script reads first. The visitor sees their version in the first paint, and the test still counts them.
<script type="application/json" id="outflare-flags">{"anonymousId":"the visitor's id","flags":{"pricing-headline":"faster"},"payloads":{}}</script>Decide for the visitor’s of_aid cookie when they have one; otherwise make an id (8 to 64 letters, digits and dashes) and the script keeps it for the visit. The SDKs build the tag for you, escaped so content in a version can’t break out of it: flagsBootstrapTag in TypeScript and flags_bootstrap_tag in Python. The same works at the edge, such as a Cloudflare Worker in front of a static site. Keep your API token on the server.
Hide the page until the flags arrive. On a static site with no server of your own, put this first in your <head>. The page stays hidden until the flags arrive, and never longer than one and a half seconds:
<script>document.documentElement.classList.add("of-wait"); setTimeout(function () { document.documentElement.classList.remove("of-wait"); }, 1500);</script><style>.of-wait body { opacity: 0 }</style>Within a visit, the next page starts with the last answer at once. An A/B test’s checklist shows how long visitors actually waited for their version.
See a version yourself
Section titled “See a version yourself”Add ?of_flag=pricing-headline:faster to any page’s address to see that version, even before the flag is on. It lasts for the rest of your visit and only in your browser. Several go in one parameter: ?of_flag=pricing-headline:faster,chat-widget:on.
Change a page without code
Section titled “Change a page without code”For a version of a split, open the flag in Analytics → Feature flags (or a test in A/B tests), enter a page of your site under Page to edit on, and choose Edit visually next to the version. The page opens in a new tab with that version and an editor over it. A bar along the top switches between versions (today’s page is shown but can’t be changed), and has Undo and Redo, whether everything is saved, Save and Close. Click anything on the page, then:
- Content: change its text, plain or with simple formatting (
**bold**,*italic*,[a link](/page)and new lines), or a link or an image. Or double-click text and type straight on the page. - Style: its text colour, background, size, weight, alignment, padding, margin, corners, border, width and more.
- Move: up or down among the elements around it, or drag it by its handle to where it should go.
- Add: a new piece of text, a button, a link or an image next to it.
- Hide it.
Layers lists the page’s headings, text, buttons, links and images, to pick one without hunting for it. Changes lists everything the version changes: point at one to see it on the page, or remove it.
Ask AI, on a version of an A/B test of a page: describe a change to the whole page, or pick a part first and describe a change to just that part, such as “make this shorter and say Start free”. Your own AI model writes it and it shows on the page at once: Keep it or Undo it. This uses the AI model your workspace connected under Settings → AI model, billed to your own AI provider account; without one, the editor says where to connect it.
Changes can apply to phones only or wider screens only. Preview on a phone opens the page in a phone-sized window. Under Settings in the editor, a version can have its own CSS (looks only) and can send its visitors to another page of your site instead, for a split URL test. Save in the editor, and visitors who get that version see the changes within a minute.
No developer is needed: the page only needs the tracking script, without data-flags. While a test with editor changes runs, the script asks for each visitor’s version by itself; a site with no tests makes almost no extra requests. To turn this off for a site, switch off Run A/B tests on this site in its tracking settings, or put data-flags="off" on the tag.
No flicker. The script hides just the parts a visitor’s version changes until their version is in, for a second at most. To make sure returning visitors never see the original, paste the optional guard from the site’s tracking settings (Optional: stop A/B tests flashing the original) once at the very top of your site’s <head>.
- Each change applies to every element like the one you clicked.
- Nothing the editor saves can run code: there’s no way to add a script or HTML from the dashboard. Code-level tests stay with your developers.
- Links, images and redirects only go to
https://addresses or paths on your site, and redirects only to the brand’s own domains. - On pages that change without reloading, the script applies the changes again when new content appears.
- Showing a visitor the changes counts them in the flag’s A/B test.
- A version holds up to 50 changes. They’re kept in its content as
changes, so you can also write or review them there.
The editor link works for two hours, only for that flag’s versions, and only while you can still change flags. It carries a secret, so don’t share it.
On your servers
Section titled “On your servers”There are two ways. To decide without a network call on each request, let the server library keep the flags in memory: it reads your brand’s live flags from GET /v1/brands/{brand}/flags/definitions, refreshes them every 30 seconds, and decides each visitor’s version itself, with the same answer the website script and the API give.
import { createClient, LocalFlags } from "@outflare/sdk";const flags = new LocalFlags(createClient({ baseUrl: "https://app.outflare.ai", token: process.env.OUTFLARE_TOKEN }), { brand: "northpeak" });const variant = await flags.variant("pricing-headline", { anonymousId, url: request.url });Python has the same LocalFlags with variant, is_enabled and payload. When you show someone a version from your server, call tracker.exposed(key, variant, { anonymousId }) so the A/B test counts them. The token needs analytics.read and stays on your server. For rules about people, pass the lists and fields you already know for that person.
Or ask Outflare each time:
Ask POST /v1/brands/{brand}/flags/evaluate with an API token that has analytics.read, passing the visitor’s id from the page (outflare.anonymousId()) as anonymous_id so the server agrees with the page. It returns each flag that is on with the visitor’s version and why. Agents use the MCP tools list_flags, create_flag, update_flag, archive_flag and evaluate_flags, and list_flag_groups, set_flag_group_holdout and get_flag_group_holdout for exclusion groups.
Who can change them
Section titled “Who can change them”Anyone with analytics.read sees flags; changing them needs analytics.manage (owners, admins and operators by default). Every change is in the audit log.