Integration requirements
To complete your integration, you will need:- An integration framework manifest listing, that you will create as part of this guide
- Publicly hosted documentation of your integration, that includes how a LaunchDarkly member should scope their API access token
- A private Loom video or other recorded walkthrough of the integration
- A grayscale SVG logo that will be displayed in the LaunchDarkly Integrations documentation and in the LaunchDarkly user interface
Build an integration
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:- Fork the LaunchDarkly Integration Framework repository.
- Create a new directory.
- Determine how to send your cohort payload to LaunchDarkly, and what response you require.
- This step is unique to creating a synced segment integration. To learn more, read Methods of sending cohort payload, below.
- Create an integration manifest and add image assets.
- Include details of your cohort request and response payload in the
capabilities/syncedSegmentssection 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.
- For this integration, define the
syncedSegmentcapability. To learn more, read Manifest details, below.
- For this integration, you can test locally using the LaunchDarkly integration validation server.
- Email ecosystem@launchdarkly.com to schedule a final walkthrough.
API details
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:| Request element | Description |
|---|---|
| Base URL | https://app.launchdarkly.com |
| Resource | /api/v2/segment-targets/YOUR_INTEGRATION_KEYReplace YOUR_INTEGRATION_KEY with the directory name of your integration in the integration framework GitHub repository. |
| REST method | POST |
| Headers |
|
| Request body | The format for the request body depends on how you’ve defined the cohort payload in your integration manifest. |
| Response | By default, LaunchDarkly returns one of the following response codes: 204, success; 400, parsing problem; 403, unauthorized; 500, internal error. You can configure a custom response by adding a jsonResponseBody specification to the request parser. |
Methods of sending cohort payload
As a partner, you have three options for how to send the cohort or audience payload to LaunchDarkly:- Boolean property: send a single cohort member. Use a
booleanproperty to indicate whether a member is added or removed. When the property istrue, it means a member should be added. When the property isfalse, it means the member should be removed. To review an example, read Boolean property. - Named arrays of cohort entries: send
addandremovearrays containing a list of cohort members to add and remove. The samememberArrayParserwill be used to parse information from both arrays. To review an example, read Separate named arrays. - Single property: send a single
actionproperty for the entire batch of cohort members, indicating whether they should all be added or removed. To review an example, read Single property.
Manifest details
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 acapabilities key with a nested object with the key syncedSegment:
requestParser directly in the Integration Framework manifest schema.
Image assets
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 thesquare key of the icons object in your integration manifest.
Conclusion
This guide describes the process of building a synced segment integration. To learn more about building your own integrations, read Building partner integrations.Want to know more? Start a trial.Your 14-day trial begins as soon as you sign up. Get started in minutes using the in-app Quickstart. You’ll discover how easy it is to release, monitor, and optimize your software.
Want to try it out? Start a trial.
Want to try it out? Start a trial.