FeatureFlag

July 9, 2025 ยท View on GitHub

Example Usage

import { FeatureFlag } from "@launchdarkly/mcp-server/models/components";

let value: FeatureFlag = {
  name: "My Flag",
  kind: "boolean",
  description: "This flag controls the example widgets",
  key: "flag-key-123abc",
  version: 1,
  creationDate: 291422,
  variations: [
    {
      id: "e432f62b-55f6-49dd-a02f-eb24acf39d05",
      value: true,
    },
    {
      id: "a00bf58d-d252-476c-b915-15a74becacb4",
      value: false,
    },
  ],
  temporary: true,
  tags: [
    "example-tag",
  ],
  links: {
    "parent": {
      href: "/api/v2/flags/my-project",
      type: "application/json",
    },
    "self": {
      href: "/api/v2/flags/my-project/my-flag",
      type: "application/json",
    },
  },
  maintainerId: "569f183514f4432160000007",
  maintainer: {
    links: {
      "self": {
        href: "/api/v2/members/569f183514f4432160000007",
        type: "application/json",
      },
    },
    id: "569f183514f4432160000007",
    firstName: "Ariel",
    lastName: "Flores",
    role: "admin",
    email: "ariel@acme.com",
  },
  maintainerTeamKey: "team-1",
  maintainerTeam: {
    key: "team-key-123abc",
    name: "Example team",
    links: {
      "parent": {
        href: "/api/v2/teams",
        type: "application/json",
      },
      "roles": {
        href: "/api/v2/teams/example-team/roles",
        type: "application/json",
      },
      "self": {
        href: "/api/v2/teams/example-team",
        type: "application/json",
      },
    },
  },
  experiments: {
    baselineIdx: 115846,
    items: [],
  },
  customProperties: {},
  archived: false,
  deprecated: false,
  defaults: {
    onVariation: 0,
    offVariation: 1,
  },
  migrationSettings: {
    contextKind: "device",
    stageCount: 6,
  },
  environments: {
    "my-environment": {
      on: false,
      archived: false,
      salt: "61eddeadbeef4da1facecafe3a60a397",
      sel: "810edeadbeef4844facecafe438f2999492",
      lastModified: 1627071171347,
      version: 1,
      targets: [
        {
          values: [
            "user-key-123abc",
          ],
          variation: 0,
          contextKind: "user",
        },
      ],
      contextTargets: [
        {
          values: [
            "device-key-123abc",
          ],
          variation: 0,
          contextKind: "device",
        },
      ],
      rules: [],
      fallthrough: {
        variation: 0,
      },
      offVariation: 1,
      prerequisites: [],
      site: {
        href: "/default/my-environment/features/client-side-flag",
        type: "text/html",
      },
      environmentName: "My Environment",
      trackEvents: false,
      trackEventsFallthrough: false,
      summary: {
        variations: {
          "0": {
            rules: 0,
            nullRules: 0,
            targets: 1,
            contextTargets: 1,
            isFallthrough: true,
          },
          "1": {
            rules: 0,
            nullRules: 0,
            targets: 0,
            contextTargets: 476279,
            isOff: true,
          },
        },
        prerequisites: 0,
      },
    },
  },
};

Fields

FieldTypeRequiredDescriptionExample
namestring:heavy_check_mark:A human-friendly name for the feature flagMy Flag
kindcomponents.FeatureFlagKind:heavy_check_mark:Kind of feature flagboolean
descriptionstring:heavy_minus_sign:Description of the feature flagThis flag controls the example widgets
keystring:heavy_check_mark:A unique key used to reference the flag in your codeflag-key-123abc
versionnumber:heavy_check_mark:Version of the feature flag1
creationDatenumber:heavy_check_mark:N/A
includeInSnippetboolean:heavy_minus_sign:: warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK
true
clientSideAvailabilitycomponents.ClientSideAvailability:heavy_minus_sign:N/A
variationscomponents.Variation[]:heavy_check_mark:An array of possible variations for the flag[
{
"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05",
"value": true
},
{
"_id": "a00bf58d-d252-476c-b915-15a74becacb4",
"value": false
}
]
temporaryboolean:heavy_check_mark:Whether the flag is a temporary flagtrue
tagsstring[]:heavy_check_mark:Tags for the feature flag[
"example-tag"
]
linksRecord<string, components.Link>:heavy_check_mark:The location and content type of related resources{
"parent": {
"href": "/api/v2/flags/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
}
}
maintainerIdstring:heavy_minus_sign:Associated maintainerId for the feature flag569f183514f4432160000007
maintainercomponents.MemberSummary:heavy_minus_sign:N/A
maintainerTeamKeystring:heavy_minus_sign:The key of the associated team that maintains this feature flagteam-1
maintainerTeamcomponents.MaintainerTeam:heavy_minus_sign:N/A
goalIdsstring[]:heavy_minus_sign:: warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated, use experiments instead
[]
experimentscomponents.ExperimentInfoRep:heavy_check_mark:N/A
customPropertiesRecord<string, components.CustomProperty>:heavy_check_mark:N/A
archivedboolean:heavy_check_mark:Boolean indicating if the feature flag is archivedfalse
archivedDatenumber:heavy_minus_sign:N/A
deprecatedboolean:heavy_minus_sign:Boolean indicating if the feature flag is deprecatedfalse
deprecatedDatenumber:heavy_minus_sign:N/A
defaultscomponents.Defaults:heavy_minus_sign:N/A
purposestring:heavy_minus_sign:N/A
migrationSettingscomponents.FlagMigrationSettingsRep:heavy_minus_sign:N/A
environmentsRecord<string, components.FeatureFlagConfig>:heavy_minus_sign:Details on the environments for this flag. Only returned if the request is filtered by environment, using the filterEnv query parameter.{
"my-environment": {
"_environmentName": "My Environment",
"_site": {
"href": "/default/my-environment/features/client-side-flag",
"type": "text/html"
},
"_summary": {
"prerequisites": 0,
"variations": {
"0": {
"contextTargets": 1,
"isFallthrough": true,
"nullRules": 0,
"rules": 0,
"targets": 1
},
"1": {
"isOff": true,
"nullRules": 0,
"rules": 0,
"targets": 0
}
}
},
"archived": false,
"contextTargets": [
{
"contextKind": "device",
"values": [
"device-key-123abc"
],
"variation": 0
}
],
"fallthrough": {
"variation": 0
},
"lastModified": 1627071171347,
"offVariation": 1,
"on": false,
"prerequisites": [],
"rules": [],
"salt": "61eddeadbeef4da1facecafe3a60a397",
"sel": "810edeadbeef4844facecafe438f2999492",
"targets": [
{
"contextKind": "user",
"values": [
"user-key-123abc"
],
"variation": 0
}
],
"trackEvents": false,
"trackEventsFallthrough": false,
"version": 1
}
}