splitchAlpha

DocsFlagsflags.md

Flags.

Per-Environment Configuration: enabled, rollout, availableVariantNames, and Targeting Rules.

A Flag is defined once per App (key, Variants, Default Variant). What each Environment serves is a separate Flag Configuration. Creating a Flag does not turn it on.

Fresh Configuration defaults

A newly created Flag starts with Configuration enabled: false and rollout: null in every Environment. Until you change those, evaluation returns the Default Variant with reason: "DISABLED" — that is an inert Flag, not a successful rollout.

splitch flag-config get new-checkout --json

Enable and roll out

Flip both controls in one call when you want the non-default Variant for everyone in the Environment:

splitch flag-config update new-checkout --enabled true --rollout 100
  • --enabled true — the Flag is serving; false stops serving and always returns the Default Variant with DISABLED.
  • --rollout 100 — baseline percentage for traffic that matches no Targeting Rule. 100 serves the non-default candidate for everyone; omit or leave null to keep the Default Variant after enable (reason: "DEFAULT").
  • Pass --rollout none to clear the baseline. The server owns the bucketing salt; you never set it.

availableVariantNames

availableVariantNames narrows which catalog Variants this Environment may serve. Empty means never narrowed — the full Flag catalog is eligible — not "nothing is promoted." That is why --rollout 100 works on a fresh Flag without first listing Variants.

Targeting Rules

Ordered rules decide matched traffic before the baseline rollout. First match wins. Rules may only target Variants in the Environment's available set (or the full catalog when that set is empty). The common equality case is one command:

splitch flag-targeting-rules add new-checkout --when plan=enterprise --serve on

Repeat --when to AND Conditions. add generates the rule id, resolves the Variant by name, and appends via replace (last-write-wins). --when values are strings (evaluation uses Object.is); number or boolean Conditions need flag-targeting-rules replace --body-json. For Segments, non-equality operators, OR groups, reordering, or removal, hand-author the full list the same way.

A matched rule's own percentage (if any) splits that rule's traffic; the Configuration rollout only decides fall-through traffic that matched no rule.

Verify what you configured

splitch flags verify new-checkout --targeting-key test-user-1 --json
# before enable:  {"value":false,"variantName":"off","reason":"DISABLED"}
# after enable+100: {"value":true,"variantName":"on","reason":"SPLIT"}

See the platform quickstart for the full zero-to-resolving path.

Also available as /docs/flags.md. Indexed from /llms.txt.