This guide explains how LaunchDarkly partners can use the integration framework to build a synced segments integration.
Synced segments allow partners to sync a segment, or set of contexts, to LaunchDarkly. Contexts are people, services, machines, or other resources that encounter feature flags. LaunchDarkly members use segments to perform targeted rollouts of features. To learn more, read Contexts and Segments.
As a partner, a segment may be called a “cohort” or similar in your application. You can develop an integration that syncs cohort members from your application to LaunchDarkly, using a LaunchDarkly REST API endpoint. The endpoint receives a JSON payload with the unique identifiers of the cohort members and performs data translation using a specified parser.
With this endpoint, you can add or remove a list of contexts from a cohort, using any of three different options for a JSON payload. You will need the cohort name and ID, and configuration details, such as the LaunchDarkly client-side ID.
By the end of this guide, you as a LaunchDarkly partner should have the information you need to create a synced segments integration.
To complete your integration, you will need:
To build an integration, make sure you meet the prerequisites. Then follow the steps outlined on the Getting started page.
The Getting started page explains many of the following steps in detail:
capabilities/syncedSegments section of the manifest. For an example of a completed manifest, read the Amplitude synced segment manifest. To learn more about the image assets, read Image assets, below.syncedSegment capability. To learn more, read Manifest details, below.The following sections provide configuration guidance specific to synced segments integrations.
To sync cohort members from your application to LaunchDarkly, use this LaunchDarkly REST API endpoint that receives a JSON payload and performs data translation using a specified parser.
Here’s how to structure your request to sync cohort members:
As a partner, you have three options for how to send the cohort or audience payload to LaunchDarkly:
boolean property to indicate whether a member is added or removed. When the property is true, it means a member should be added. When the property is false, it means the member should be removed. To review an example, read Boolean property.add and remove arrays containing a list of cohort members to add and remove. The same memberArrayParser will be used to parse information from both arrays. To review an example, read Separate named arrays.action property for the entire batch of cohort members, indicating whether they should all be added or removed. To review an example, read Single property.To learn more, read Synced segments capability.
Each LaunchDarkly partner integration requires an integration manifest. For general information on how to create this, read Defining an integration manifest.
When you create a synced segment integration, your manifest must also include a capabilities key with a nested object with the key syncedSegment:
To review an example, read the Amplitude synced segment manifest.
To learn more about the supported fields, read the Synced segments capability documentation. You can also find information on the fields supported by the requestParser directly in the Integration Framework manifest schema.
All partner integrations have the partner logos appear in the LaunchDarkly Integrations documentation and in the LaunchDarkly user interface on the Integrations list. To learn more, read SVG logo files.
Additionally, all synced segment partner integrations have the partner logos appear in the LaunchDarkly Segments list and on the segment details page. The logo is pulled from the square key of the icons object in your integration manifest.
This guide describes the process of building a synced segment integration. To learn more about building your own integrations, read Building partner integrations.