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.

1. In LaunchDarkly, go to **Account Settings → Authorization**.
2. Click **+ Token**.
3. Enter a name for the token.
4. Select *Writer* from the Role dropdown list.
5. Select the appropriate API version from the *API version* dropdown list.
6. When finished, save the token. Copy the token from the *Authorization* tab.
7. Go to the **Projects** tab and copy the client side ID from the project you want to export Amplitude cohorts to.

### Amplitude setup

1. In Amplitude Data, click **Catalog** and select the **Destinations** tab.
2. In the Cohort section, click **LaunchDarkly**.
3. Enter a name.
4. Paste the access token and client-side ID.
5. Map an Amplitude property to the LaunchDarkly user key.

{% callout type="note" title="" %}
Choose a matching user identifier in Amplitude and LaunchDarkly. The identifier is often `userID`, but could also be a device ID.
{% /callout %}

6. Save when finished.

## Send a cohort

After you connect LaunchDarkly to Amplitude, you can sync any Amplitude cohort to LaunchDarkly.

1. In Amplitude, open the cohort you want to export. Click **Sync**, and choose LaunchDarkly.
2. Choose the API target. The API target is the name you gave the integration in Amplitude.
3. 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.
4. 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.
