LaunchDarkly
With Amplitude's LaunchDarkly integration, you can export your Amplitude cohorts and use them as segmentation and targeting criteria in LaunchDarkly. From there, you can create feature flags for specific segments of users defined by your Amplitude data.
Set up the integration
LaunchDarkly setup
To set up this integration, you need an access token and client-side ID from LaunchDarkly.
- In LaunchDarkly, go to Account Settings → Authorization.
- Click + Token.
- Enter a name for the token.
- Select Writer from the Role dropdown list.
- Select the appropriate API version from the API version dropdown list.
- When finished, save the token. Copy the token from the Authorization tab.
- Go to the Projects tab and copy the client side ID from the project you want to export Amplitude cohorts to.
Amplitude setup
- In Amplitude Data, click Catalog and select the Destinations tab.
- In the Cohort section, click LaunchDarkly.
- Enter a name.
- Paste the access token and client-side ID.
- Map an Amplitude property to the LaunchDarkly user key.
Choose a matching user identifier in Amplitude and LaunchDarkly. The identifier is often userID, but could also be a device ID.
- Save when finished.
Send a cohort
After you connect LaunchDarkly to Amplitude, you can sync any Amplitude cohort to LaunchDarkly.
- In Amplitude, open the cohort you want to export. Click Sync, and choose LaunchDarkly.
- Choose the API target. The API target is the name you gave the integration in Amplitude.
- Select the sync cadence. If you're not sure which selection is best, set up automated, recurring syncs for strategically essential cohorts. One-time syncs are more appropriate for project work.
- Save your work.
After Amplitude syncs the cohort with LaunchDarkly, Amplitude creates a LaunchDarkly segment. The segment appears in the Segments section in LaunchDarkly with an Amplitude logo next to it. Use this segment for targeting rules in feature flags you set up in LaunchDarkly.
Was this helpful?