The LaunchDarkly Integration Validation Server is a tool that developers can use to test their integrations with LaunchDarkly. This server provides an environment where developers can validate their integrations with LaunchDarkly's feature flag management platform.
To use the LaunchDarkly Integration Validation Server, follow the steps below:
- Node.js (version 16 or above)
- npm (Node Package Manager)
- Clone the repository to your local machine:
git clone https://github.com/launchdarkly/integration-framework.git
- Install the required dependencies:
npm install
To start the server, run the following command:
npm run start:server
The server starts running and listens on port 3000 by default.
After the server is running, you can make HTTP requests to the server endpoints to test your integration. The server provides several routes that simulate LaunchDarkly's API behavior. No authentication token is required to make requests to the endpoints.
The LaunchDarkly Integration Validation Server exposes the following endpoints:
Endpoint | Method | Description |
---|---|---|
/api/v2/segment-target/:integrationKey |
POST | Simulates processing a synced segment data from a Customer Data Provider (CDP). Replace :integrationKey with the name of the directory that you are adding to the integration-framework repository under integrations/ . |
To validate that a segment from a Customer Data Platform (CDP) will be successfully parsed and processed, you can make the following curl request:
curl --location 'http://localhost:3000/api/v2/segment-target/example-integration-key' \
--header 'Content-Type: application/json' \
--data '{
"environmentId": "example-client-side-ID",
"batch": [
{
"userId": "example-cdp-user-1234",
"cohortName": "Example Segment 1234",
"cohortId": "segment-12345",
"cohortUrl": "https://example-cdp.com",
"value": true
}
]
}'
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the project's GitHub repository.