FeatureFlagBody

May 22, 2025 ยท View on GitHub

Example Usage

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

let value: FeatureFlagBody = {
  name: "My flag",
  key: "flag-key-123abc",
  description: "This flag controls the example widgets",
  clientSideAvailability: {
    usingEnvironmentId: true,
    usingMobileKey: true,
  },
  variations: [
    {
      value: true,
    },
    {
      value: false,
    },
  ],
  temporary: false,
  tags: [
    "example-tag",
  ],
  customProperties: {
    "key": {
      name: "Jira issues",
      value: [
        "is-123",
        "is-456",
      ],
    },
  },
  defaults: {
    onVariation: 0,
    offVariation: 1,
  },
  purpose: "migration",
  maintainerId: "12ab3c45de678910fgh12345",
  maintainerTeamKey: "team-1",
};

Fields

FieldTypeRequiredDescriptionExample
namestring:heavy_check_mark:A human-friendly name for the feature flagMy flag
keystring:heavy_check_mark:A unique key used to reference the flag in your codeflag-key-123abc
descriptionstring:heavy_minus_sign:Description of the feature flag. Defaults to an empty string.This flag controls the example widgets
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. Defaults to false.
clientSideAvailabilitycomponents.ClientSideAvailabilityPost:heavy_minus_sign:N/A
variationscomponents.Variation[]:heavy_minus_sign:An array of possible variations for the flag. The variation values must be unique. If omitted, two boolean variations of true and false will be used.[
{
"value": true
},
{
"value": false
}
]
temporaryboolean:heavy_minus_sign:Whether the flag is a temporary flag. Defaults to true.false
tagsstring[]:heavy_minus_sign:Tags for the feature flag. Defaults to an empty array.[
"example-tag"
]
customPropertiesRecord<string, components.CustomProperty>:heavy_minus_sign:N/A
defaultscomponents.Defaults:heavy_minus_sign:N/A
purposecomponents.Purpose:heavy_minus_sign:Purpose of the flagmigration
migrationSettingscomponents.MigrationSettingsPost:heavy_minus_sign:N/A
maintainerIdstring:heavy_minus_sign:The ID of the member who maintains this feature flag12ab3c45de678910fgh12345
maintainerTeamKeystring:heavy_minus_sign:The key of the team that maintains this feature flagteam-1
initialPrerequisitescomponents.FlagPrerequisitePost[]:heavy_minus_sign:Initial set of prerequisite flags for all environments
isFlagOnboolean:heavy_minus_sign:Whether to automatically turn the flag on across all environments at creation. Defaults to false.