Skip to content

Variations

A variation is one of the possible values a flag can return. Every flag has at least two. Targeting rules, individual targets, and default rules all pick a variation by name; the SDK returns its value.

A flag is one of four value types, fixed at creation:

TypeUse it forExample variations
booleanOn/off switches, kill switches, simple A/B.true, false
stringVariant names, copy, choice between known strings."control", "variant-a", "variant-b"
numberNumeric thresholds, sample rates, request limits.0, 100, 1000
jsonAny structured value.{"theme":"dark","density":"compact"}

A boolean flag always has exactly two variations. The other types let you add as many as you want; in practice, keep the list short.

Every variation has a name (for the dashboard and the audit log) and a value (what the SDK returns). The name is independent of the value; you can call a string variation “Control copy” and have its value be "You'll love this".

For non-boolean flags, the variation name is what shows up in targeting rules. So name them for the reader of the rule:

✗ variation v1 = "purple"
✗ variation v2 = "blue"
✓ variation control = "purple"
✓ variation experiment = "blue"

Each environment carries an off-variation: the variation served when targeting for that flag is off. Pick the safest value. For a kill switch, the off-variation is the path that does nothing. For a new feature, the off-variation is the old behavior.

The off-variation is also what the SDK returns when the flag is archived.

You can rename a variation or change its value at any time, but think before you do. Changing a variation’s value changes what every targeting rule that points at it returns, immediately, in that environment. If a rule on rule paying-customers serves variation new-checkout = "/checkout/v2", and you change that to "/checkout/v3", every paying customer flips.

You cannot delete a variation that any rule, target, or default points to. Repoint or remove the references first.