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
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
name | string | :heavy_check_mark: | A human-friendly name for the feature flag | My flag |
key | string | :heavy_check_mark: | A unique key used to reference the flag in your code | flag-key-123abc |
description | string | :heavy_minus_sign: | Description of the feature flag. Defaults to an empty string. | This flag controls the example widgets |
includeInSnippet | boolean | :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. | |
clientSideAvailability | components.ClientSideAvailabilityPost | :heavy_minus_sign: | N/A | |
variations | components.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 } ] |
temporary | boolean | :heavy_minus_sign: | Whether the flag is a temporary flag. Defaults to true. | false |
tags | string[] | :heavy_minus_sign: | Tags for the feature flag. Defaults to an empty array. | [ "example-tag" ] |
customProperties | Record<string, components.CustomProperty> | :heavy_minus_sign: | N/A | |
defaults | components.Defaults | :heavy_minus_sign: | N/A | |
purpose | components.Purpose | :heavy_minus_sign: | Purpose of the flag | migration |
migrationSettings | components.MigrationSettingsPost | :heavy_minus_sign: | N/A | |
maintainerId | string | :heavy_minus_sign: | The ID of the member who maintains this feature flag | 12ab3c45de678910fgh12345 |
maintainerTeamKey | string | :heavy_minus_sign: | The key of the team that maintains this feature flag | team-1 |
initialPrerequisites | components.FlagPrerequisitePost[] | :heavy_minus_sign: | Initial set of prerequisite flags for all environments | |
isFlagOn | boolean | :heavy_minus_sign: | Whether to automatically turn the flag on across all environments at creation. Defaults to false. |