Skip to content
Software capabilities
LaunchDarkly

How to compare a LaunchDarkly flag across environments

Read a flag’s environment settings through the REST API for a scripted comparison, or open the Flag comparison screen to inspect two environments side by side.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. API: GET /api/v2/flags/{projectKey}/{featureFlagKey}
  2. Interface: Flag comparison screen
API

GET /api/v2/flags/{projectKey}/{featureFlagKey}

Read one flag’s configuration across environments. Use the env parameter to limit the environments returned.

Read source: LaunchDarkly Get feature flag
Requirements
A LaunchDarkly API access token with read permission, the project key, and the feature flag key.
Limitations
The default response includes every environment’s configuration and can be large. Request only the environments you need with env.

Example shell

curl --fail -H "Authorization: $LD_API_TOKEN" \
  "https://app.launchdarkly.com/api/v2/flags/$PROJECT_KEY/$FLAG_KEY"
Interface

Flag comparison screen

Open Feature management > Flags, choose Compare to another environment, and inspect the flag settings and targeting differences.

Read source: LaunchDarkly compare and copy flag settings
Requirements
A LaunchDarkly member with access to the project and the environments being compared.
Limitations
The comparison shows two environments at a time. Matching segment names can still refer to distinct segments.

Example text

LaunchDarkly → Feature management → Flags → environment menu → Compare to another environment → select two environments