Adding a custom approvals integration configuration
Read time: 3 minutes
Last edited: Oct 30, 2024
Overview
This topic describes how to add a custom approvals integration within LaunchDarkly. This is the second step required when building a custom approvals integration. Only customers with complex workflow management or approval systems in third-party applications that LaunchDarkly does not integrate with directly are likely to need a custom approvals integration.
Add the custom approvals integration
After you create your own approval application, you must set up an integration configuration to connect LaunchDarkly and your approval application.
To configure your custom approvals integration in LaunchDarkly:
- In the LaunchDarkly UI, navigate to the Integrations page.
- Search for the "Custom approvals" integration.
- Click Add integration. A "Create configuration" panel appears.
- Set the Status of the integration to On.
- (Optional) Enter a Name for the integration. This is the name that will appear when you update your LaunchDarkly environment approval settings to use your custom approvals integration.
- Enter the API Token that LaunchDarkly should use to authenticate when sending requests to your approval application.
- Enter the Custom approval service base URL of your custom approval service. This is where LaunchDarkly will send requests.
- (Optional) Enter the Additional form variables. This is a JSON schema describing the information that a LaunchDarkly account member needs to enter when they create an approval request.
Expand for JSON schema details
Here is an example of the additional form variables JSON schema:
[{// required// how your custom approvals application references this field// LaunchDarkly uses the value here as a key// in the "additionalFormVariables" object// in the creationRequest that LaunchDarkly sends to your application"key": "exampleKey",// required// name of the field displayed in the LaunchDarkly approval request UI"name": "Example field",// required// field type, can be any of 'string', 'boolean', 'uri', 'enum', and 'dynamicEnum'"type": "string",// required// field description displayed in the LaunchDarkly approval request UI"description": "Example description",// optional// placeholder text displayed in the LaunchDarkly approval request UI"placeholder": "Example description",// optional// whether the field is optional// if not specified, defaults to false"isOptional": false,// optional// value if field left unspecified in the LaunchDarkly approval request UI"defaultValue": null,// optional// array of allowed strings for enum-type fields"allowedValues": null,// required if type is set to dynamicEnum// defines the request for getting dynamic options and the paths to parse them out of the response"dynamicOptions": {"endpoint": { // required. hostname must match the baseURL of the integration configuration"url": "https://your-application-host.com/api/colors","method": "GET", // can only be GET"headers": [{"name": "Authorization","value": "Bearer {{ apiKey }}" // apiKey will auto-fill with the apiKey defined on the integration configuration}]},"parser": {"optionsPath": "/data","optionsItems": {"label": "/name","value": "/value"}}}},{// additional fields}]
- Click Save configuration.