Integrations / LaunchDarkly
LaunchDarkly
Feature flags: list projects and flags, read a flag, turn it on or off per environment, edit its description and tags, or apply a JSON patch.
8 actions
API key
3 read5 write
Calls app.launchdarkly.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "launchdarkly" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Add flag tagswritelaunchdarkly.add_flag_tagsAdd one or more tags to a feature flag using a semantic patch.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key |
flag_key | string | Required | Flag key |
tags | array of string | Required | Tags to add |
comment | string | Optional | Optional note for the audit log |
await setu.execute({
userId: "user_1",
action: "launchdarkly.add_flag_tags",
input: {
"project_key": "<project_key>",
"flag_key": "<flag_key>",
"tags": []
},
});Get feature flagreadlaunchdarkly.get_flagGet one feature flag with its variations and per-environment on/off state and targeting summary.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key |
flag_key | string | Required | Flag key, e.g. alternate.page |
env | string | Optional | Limit the result to this environment key |
await setu.execute({
userId: "user_1",
action: "launchdarkly.get_flag",
input: {
"project_key": "<project_key>",
"flag_key": "<flag_key>"
},
});List feature flagsreadlaunchdarkly.list_flagsList feature flags in a project (key, name, kind), optionally with one environment's configuration, a tag or a filter.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key, e.g. default |
env | string | Optional | Environment key to include that environment's configuration, e.g. production |
tag | string | Optional | Only flags with this tag |
limit | integer | Optional | Page size |
offset | integer | Optional | Items to skip |
filter | string | Optional | Filter such as query:dark-mode,state:live |
await setu.execute({
userId: "user_1",
action: "launchdarkly.list_flags",
input: {
"project_key": "<project_key>"
},
});List projectsreadlaunchdarkly.list_projectsList the LaunchDarkly projects the token can see: keys and names. Project keys are needed for every flag call.
| Input | Type | Description | |
|---|---|---|---|
limit | integer | Optional | Page size (default 20) |
filter | string | Optional | Optional filter such as query:abc |
await setu.execute({
userId: "user_1",
action: "launchdarkly.list_projects",
input: {},
});Update feature flag with JSON patchwritelaunchdarkly.patch_flagChange a feature flag with a JSON patch (RFC 6902) list of operations, e.g. replace /description. Send a test operation first to guard against concurrent edits.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key |
flag_key | string | Required | Flag key |
patch | array of object | Required | JSON patch operations, e.g. [{"op":"replace","path":"/description","value":"New text"}] |
await setu.execute({
userId: "user_1",
action: "launchdarkly.patch_flag",
input: {
"project_key": "<project_key>",
"flag_key": "<flag_key>",
"patch": []
},
});Turn flag offwritelaunchdarkly.turn_flag_offTurn a feature flag off in one environment using a semantic patch. This changes live targeting for that environment; environments that require approval reject it.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key |
flag_key | string | Required | Flag key |
environment_key | string | Required | Environment key, e.g. production |
comment | string | Optional | Optional note for the audit log |
await setu.execute({
userId: "user_1",
action: "launchdarkly.turn_flag_off",
input: {
"project_key": "<project_key>",
"flag_key": "<flag_key>",
"environment_key": "<environment_key>"
},
});Turn flag onwritelaunchdarkly.turn_flag_onTurn a feature flag on in one environment using a semantic patch. This changes live targeting for that environment; environments that require approval reject it.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key |
flag_key | string | Required | Flag key |
environment_key | string | Required | Environment key, e.g. production |
comment | string | Optional | Optional note for the audit log |
await setu.execute({
userId: "user_1",
action: "launchdarkly.turn_flag_on",
input: {
"project_key": "<project_key>",
"flag_key": "<flag_key>",
"environment_key": "<environment_key>"
},
});Update flag descriptionwritelaunchdarkly.update_flag_descriptionSet a feature flag's description using a semantic patch.
| Input | Type | Description | |
|---|---|---|---|
project_key | string | Required | Project key |
flag_key | string | Required | Flag key |
description | string | Required | New description |
comment | string | Optional | Optional note for the audit log |
await setu.execute({
userId: "user_1",
action: "launchdarkly.update_flag_description",
input: {
"project_key": "<project_key>",
"flag_key": "<flag_key>",
"description": "<description>"
},
});