CreateFlagEnvironments

March 13, 2026 ยท View on GitHub

Example Usage

import { CreateFlagEnvironments } from "@vercel/sdk/models/createflagop.js";

let value: CreateFlagEnvironments = {
  active: true,
  pausedOutcome: {
    type: "<value>",
    variantId: "<id>",
  },
  rules: [
    {
      id: "<id>",
      conditions: [
        {
          lhs: {
            type: "<value>",
            kind: "<value>",
            attribute: "<value>",
          },
          cmp: "containsAnyOf",
        },
      ],
      outcome: {
        type: "<value>",
        base: {
          type: "<value>",
          kind: "<value>",
          attribute: "<value>",
        },
        weights: {},
        defaultVariantId: "<id>",
      },
    },
  ],
  fallthrough: {
    type: "<value>",
    base: {
      type: "<value>",
      kind: "<value>",
      attribute: "<value>",
    },
    weights: {
      "key": 21.45,
      "key1": 2447.61,
    },
    defaultVariantId: "<id>",
  },
};

Fields

FieldTypeRequiredDescription
activeboolean:heavy_check_mark:N/A
reusemodels.CreateFlagReuse:heavy_minus_sign:Allows linking this environment to another environment so this flag will be evaluated with the other flag's configuration
targetsRecord<string, Record<string, Record<string, models.CreateFlagTargets[]>>>:heavy_minus_sign:Allows assigning targets to variants while bypassing the flag's rules
pausedOutcomemodels.CreateFlagPausedOutcome:heavy_check_mark:N/A
rulesmodels.CreateFlagRules[]:heavy_check_mark:N/A
fallthroughmodels.CreateFlagFallthrough:heavy_check_mark:N/A
revisionnumber:heavy_minus_sign:The revision of the environment config