Send Cohorts to 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.
To set up this integration, you first need an access token and client-side ID from LaunchDarkly.
- In LaunchDarkly, navigate 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 drop-down list.
- When finished, save the token. Copy the token from the Authorization tab.
- Navigate to the Projects tab and copy the client side ID from the project you want to export Amplitude cohorts to.
- In Amplitude, navigate to Data Destinations, then find LaunchDarkly - Cohort.
- Enter a name.
- Paste the access token and client-side ID.
Map an Amplitude property to the LaunchDarkly user key.
You must make sure to choose a matching user identifier in Amplitude and LaunchDarkly. This is often
userID, but could also be a device ID. If they don't match, it won't work.
Save when finished.
Send a cohort¶
After you connect LaunchDarkly to Amplitude, you can sync any Amplitude cohort to it.
- In Amplitude, open the cohort you want to export. Click Sync, and choose LaunchDarkly.
- Choose the API target. This is the name you gave the integration in Amplitude.
- Select the sync cadence. If you're not sure which selection is best, try setting up automated, recurring syncs for any strategically essential cohorts, whereas one-time syncs are more appropriate for project work.
- Save your work.
After the cohort is synced with LaunchDarkly, Amplitude creates a LaunchDarkly segment. It's available in the Segments section in LaunchDarkly with an Amplitude logo next to it. You can then use this segment for targeting rules in feature flags you set up in LaunchDarkly.