Bosca / Experiments

Feature Flags

One flag, many answers

A feature flag is a palette of typed values and the rules that decide who gets which one. Wrap a change in a flag and you control its release without shipping again — for everyone, a segment, or a single person.

Typed variations

A palette of typed values

Every flag has a type, and its variations are values of that type — validated when you save, so a boolean flag can't accidentally serve a string. One variation is marked the default for anyone no rule matches.

  • Four flag types: boolean, percentage, string, and JSON.
  • Each variation is a named value in the flag's palette, referenced by key.
  • A default variation catches everyone a targeting rule doesn't.
flag · checkout-cta
{
  "key": "checkout-cta",
  "type": "string",
  "variations": {
    "control": "Buy now",
    "treatment": "Add to cart"
  },
  "defaultVariationKey": "control"
}

Targeting rules

Ordered rules, first match wins

A flag carries an ordered list of targeting rules, evaluated top to bottom. The first rule whose conditions all match decides the variation — and a rule can split its matched traffic across variations by weight.

  • Conditions combine five kinds of match, from broad segments to a single flag's result.
  • A matched rule can serve one variation or roll traffic across several by weight.
  • Reorder rules to change precedence — the list is the logic.

Segment

Match anyone in a given audience segment.

Principal

Match specific signed-in identities.

Profile attribute

Match on any attribute a profile carries.

Device attribute

Match on platform, version, or locale.

Flag dependency

Match on how another flag resolved.

Deterministic bucketing

The same answer, every time

When a rule splits traffic, who lands where isn't random. A stable hash of the user and a per-flag salt maps everyone to a bucket, so a person sees the same variation on every visit — until you regenerate the salt to reshuffle.

  • Bucketing is computed from the user plus the flag's salt — no assignment table needed to stay consistent.
  • The same hash powers experiments, so a test and its flag agree on who's where.
  • Regenerate the salt to re-randomize the split for a fresh run.
bucketing
user · salt
control · 50%treatment · 50%

stable hash → the same bucket, every visit

Lifecycle

From draft to retired

A flag moves through a simple lifecycle — drafted in private, enabled into service, disabled to fall back to its default, and archived when it has done its job.

DraftEnabledDisabledArchived

Keep exploring

More on Experiments