Setu Recipes: reusable digital workers across every app.Browse templates

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

TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key
flag_keystringRequiredFlag key
tagsarray of stringRequiredTags to add
commentstringOptionalOptional note for the audit log
TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key
flag_keystringRequiredFlag key, e.g. alternate.page
envstringOptionalLimit the result to this environment key
TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key, e.g. default
envstringOptionalEnvironment key to include that environment's configuration, e.g. production
tagstringOptionalOnly flags with this tag
limitintegerOptionalPage size
offsetintegerOptionalItems to skip
filterstringOptionalFilter such as query:dark-mode,state:live
TypeScript
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.
InputTypeDescription
limitintegerOptionalPage size (default 20)
filterstringOptionalOptional filter such as query:abc
TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key
flag_keystringRequiredFlag key
patcharray of objectRequiredJSON patch operations, e.g. [{"op":"replace","path":"/description","value":"New text"}]
TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key
flag_keystringRequiredFlag key
environment_keystringRequiredEnvironment key, e.g. production
commentstringOptionalOptional note for the audit log
TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key
flag_keystringRequiredFlag key
environment_keystringRequiredEnvironment key, e.g. production
commentstringOptionalOptional note for the audit log
TypeScript
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.
InputTypeDescription
project_keystringRequiredProject key
flag_keystringRequiredFlag key
descriptionstringRequiredNew description
commentstringOptionalOptional note for the audit log
TypeScript
await setu.execute({
  userId: "user_1",
  action: "launchdarkly.update_flag_description",
  input: {
    "project_key": "<project_key>",
    "flag_key": "<flag_key>",
    "description": "<description>"
  },
});