# LaunchDarkly (Actions) Destination

## Destination Info

* Accepts [Page](/docs/segment/connections/spec/page), [Alias](/docs/segment/connections/spec/alias), [Group](/docs/segment/connections/spec/group), [Identify](/docs/segment/connections/spec/identify), [Track](/docs/segment/connections/spec/track) calls.
* Refer to it as **LaunchDarkly**, **LaunchDarkly (Actions) Destination**, **LaunchDarkly (Actions)** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)
* This integration is **partner owned.** Please reach out to the partner's support for any issues.

[LaunchDarkly](https://launchdarkly.com) is a feature management platform that empowers development teams to safely deliver, control, and measure their software through feature flags.

With LaunchDarkly, you can run experiments on any feature flag. This destination allows you to connect existing Segment events to LaunchDarkly custom metrics for use in LaunchDarkly experiments.

> \[!TIP]
>
> **Good to know**: This page is about the [Actions-framework](/docs/segment/connections/destinations/actions/) LaunchDarkly Segment destination. There's also a page about the [non-Actions LaunchDarkly destination](/docs/segment/connections/destinations/catalog/launchdarkly-events/). Both of these destinations receives data from Segment.

## Benefits of LaunchDarkly (Actions) vs LaunchDarkly Classic

LaunchDarkly (Actions) provides the following benefits over the classic LaunchDarkly destination:

* **Improved customization**. You determine the mapping between the data Segment receives from your source and the data Segment sends to LaunchDarkly. For example, you can map an arbitrary event property to the LaunchDarkly metric key.
* **Increased transparency**. You can see the data that is sent to LaunchDarkly and when Segment sends it. Additionally, you can subscribe to alerts when the delivery rate to LaunchDarkly dips below a configurable threshold.

## Getting started

To get started with LaunchDarkly (Actions):

1. In LaunchDarkly, navigate to [Account settings](https://app.launchdarkly.com/settings/projects) and copy the client-side ID for the project and environment that you would like to connect to Segment.
2. From the Segment web app, click **Catalog**, then click **Destinations**.
3. Search for **LaunchDarkly (Actions)** and select it.
4. Click **Configure LaunchDarkly**.
5. Select the Source you want to connect to LaunchDarkly (Actions).
6. Paste the LaunchDarkly client-side ID you copied in step 1 into the **LaunchDarkly client-side ID** field on the destination settings page.

## Destination Settings

| Field                         | Description                                                                                                                                                           | Required | Type   |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| LaunchDarkly client-side ID   | Find and copy the client-side ID in the LaunchDarkly account settings page.                                                                                           | Yes      | string |
| LaunchDarkly events host name | Your LaunchDarkly events host name. If not specified, the default value of events.launchdarkly.com will be used. Most customers will not need to change this setting. | No       | string |

## Available Presets

LaunchDarkly (Actions) has the following presets

| Preset Name | Trigger                                        | Default Action |
| ----------- | ---------------------------------------------- | -------------- |
| Alias User  | Event type = "identify", Event  type = "alias" | Alias User     |
| Track Event | Event type = "track"                           | Track Event    |

## Available Actions

Build your own Mappings. Combine supported [triggers](/docs/segment/connections/destinations/actions/#components-of-a-destination-action) with the following LaunchDarkly-supported actions:

> \[!NOTE]
>
> Individual destination instances have support a maximum of 50 mappings.

* [Alias User](#alias-user-1)
* [Track Event](#track-event-18)

### Alias User

Alias an anonymous user with an identified user key.

Alias User is a **Cloud** action. The default Trigger is `type = "identify" or type = "alias"`

| Field           | Description                                                     | Required | Type     |
| --------------- | --------------------------------------------------------------- | -------- | -------- |
| User key        | The user's unique key.                                          | Yes      | STRING   |
| Anonymous ID    | The user's unauthenticated identifier.                          | Yes      | STRING   |
| Event Timestamp | The time when the event happened. Defaults to the current time. | No       | DATETIME |

### Track Event

Track custom events for use in A/B tests and experimentation.

Track Event is a **Cloud** action. The default Trigger is `type = "track"`

| Field                   | Description                                                                                                                                                                                                                                                                           | Required | Type     |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| Context Kind            | The event's context kind. If not specified, the context kind will default to \`user\`. To learn more about context kinds and where you can find a list of context kinds LaunchDarkly has observed, read \[Context kinds]\(https://docs.launchdarkly.com/home/contexts/context-kinds). | No       | STRING   |
| Context Key             | The unique LaunchDarkly context key. In most cases the Segment \`userId\` should be used.                                                                                                                                                                                             | Yes      | STRING   |
| Additional Context Keys | A mapping of additional context kinds to context keys. To learn more, read \[Contexts and segments]\(https://docs.launchdarkly.com/home/contexts).                                                                                                                                    | No       | OBJECT   |
| Event Name              | The name of the event to track. This name typically corresponds to a LaunchDarkly metric with the same key.                                                                                                                                                                           | Yes      | STRING   |
| Metric Value            | The numeric value associated with the event. This value is used by the LaunchDarkly experimentation feature in numeric custom metrics, and will also be returned as part of the custom event for Data Export.                                                                         | No       | NUMBER   |
| Event Properties        | Optional object containing the properties for the event being tracked. These properties assist with observational analytics for LaunchDarkly Data Export destinations. These properties are not saved to the LaunchDarkly user.                                                       | No       | OBJECT   |
| Event timestamp         | The time when the event happened. Defaults to the current time.                                                                                                                                                                                                                       | No       | DATETIME |

> \[!NOTE]
>
> LaunchDarkly doesn't store user attributes for use with flag evaluations. As a result, Segment doesn't support mapping Identify calls to LaunchDarkly actions.

## Creating LaunchDarkly metrics

In order to take full-advantage of the LaunchDarkly (Actions) Destination, you need to create metrics in LaunchDarkly that correspond to Segment track events. Read [Creating metrics](https://docs.launchdarkly.com/home/experimentation/metrics) to learn how to create metrics in LaunchDarkly.

## Migration from the classic LaunchDarkly destination

Be sure to disconnect the classic LaunchDarkly destination before enabling the LaunchDarkly (Actions) destination to avoid duplicate experimentation events in LaunchDarkly.
