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
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
name | string | :heavy_check_mark: | A human-friendly name for the feature flag | My Flag |
kind | components.FeatureFlagKind | :heavy_check_mark: | Kind of feature flag | boolean |
description | string | :heavy_minus_sign: | Description of the feature flag | This flag controls the example widgets |
key | string | :heavy_check_mark: | A unique key used to reference the flag in your code | flag-key-123abc |
version | number | :heavy_check_mark: | Version of the feature flag | 1 |
creationDate | number | :heavy_check_mark: | N/A | |
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 | true |
clientSideAvailability | components.ClientSideAvailability | :heavy_minus_sign: | N/A | |
variations | components.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 } ] |
temporary | boolean | :heavy_check_mark: | Whether the flag is a temporary flag | true |
tags | string[] | :heavy_check_mark: | Tags for the feature flag | [ "example-tag" ] |
links | Record<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" } } |
maintainerId | string | :heavy_minus_sign: | Associated maintainerId for the feature flag | 569f183514f4432160000007 |
maintainer | components.MemberSummary | :heavy_minus_sign: | N/A | |
maintainerTeamKey | string | :heavy_minus_sign: | The key of the associated team that maintains this feature flag | team-1 |
maintainerTeam | components.MaintainerTeam | :heavy_minus_sign: | N/A | |
goalIds | string[] | :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 | [] |
experiments | components.ExperimentInfoRep | :heavy_check_mark: | N/A | |
customProperties | Record<string, components.CustomProperty> | :heavy_check_mark: | N/A | |
archived | boolean | :heavy_check_mark: | Boolean indicating if the feature flag is archived | false |
archivedDate | number | :heavy_minus_sign: | N/A | |
deprecated | boolean | :heavy_minus_sign: | Boolean indicating if the feature flag is deprecated | false |
deprecatedDate | number | :heavy_minus_sign: | N/A | |
defaults | components.Defaults | :heavy_minus_sign: | N/A | |
purpose | string | :heavy_minus_sign: | N/A | |
migrationSettings | components.FlagMigrationSettingsRep | :heavy_minus_sign: | N/A | |
environments | Record<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 } } |