Skip to content

Definitions

A definition is a named rule-based configuration entry. It can represent a boolean feature flag, a remote config value, or a structured object. Each definition contains an ordered list of variations and optional metadata.

Structure

Definitions can be written in YAML or JSON. Both formats are equivalent — use whichever fits your workflow.

yaml
definitions:
  my_flag:
    active: true
    description: "Controls the checkout experience"
    variations:
      - value: "new"
        conditions:
          - type: env
            value: prod
      - value: "old"
json
{
  "definitions": {
    "my_flag": {
      "active": true,
      "description": "Controls the checkout experience",
      "variations": [
        {
          "value": "new",
          "conditions": [{ "type": "env", "value": "prod" }]
        },
        { "value": "old" }
      ]
    }
  }
}
FieldRequiredDescription
variationsYesOrdered list of variations to evaluate. Evaluated top-to-bottom — first match wins. See Variations for value types, conditions, and resolution order.
activeNoSet to false to disable the definition. Resolving an inactive definition returns a ResolutionError (via showwhat()) or throws DefinitionInactiveError (via resolve()). Defaults to true.
descriptionNoHuman-readable description

Multiple definitions

A single YAML or JSON source can contain multiple definitions:

yaml
definitions:
  flag_a:
    variations:
      - value: true

  flag_b:
    variations:
      - value: "hello"
      - value: "world"