This article explains how to add custom integrations to your environment in the Evolv AI Manager.
Table of Contents
- Creating a custom integration
- Adding a custom integration to your account
- Configuring the integration in your environment
Integrations are a way of adding common code to your environment so that every project can access it.
You can use integrations for:
- Connecting to third-party tools like analytics
- Implementing helper functions for variants
- Providing updates to the context
Creating the integration
Integrations are written in JavaScript and bundled a certain way. Your integration must abide by the following set of rules.
- There needs to be a JavaScript (.js) file that contains the integration code.
- The JavaScript file includes an export function that conforms to the rules of CommonJS modules.
- Include a package.json file with at least the name, version, and main properties defined.
Example package.json file
{
"name":"My Custom Integration",
"version":"1.2.3",
"main":"index.js",
}
Example Javascript file
module.exports = function(config) {
// Code here
};
Adding a custom integration to your account
After your integration is built and tested, you can add it to your account.
- Open the Evolv AI Manager.
- Click on the Integrations option in the side navigation.
- Select NEW CUSTOM INTEGRATION to open the integration side panel.
- Enter a name and description (optional).
- Update the Configuration JSON if your integration utilizes config parameters.
- The configuration lets you re-use the same integration code in different environments and accounts.
- Only enter configuration options that apply globally. Environment-level configuration is part of the next step.
- Select ADD NEW CONNECTOR to begin connecting the integration source.
- Select the source of your integration from the drop-down: NPM, GitHub, or Gist.
- We recommend using NPM for the best experience. NPM allows for strict versioning and updates are processed immediately.
- Update all the required details and click CREATE to finish adding the integration.
The integration now appears in the list of integrations. The version number is local to the Manager and starts at 1. It increments with each change made to the integration.
Configuring the integration in your environment
Now that the integration is added to the account, you must add it to an environment to start using it.
- Click on the Environments option in the side navigation.
- Select the environment where you want to add the integration.
- In the side panel, click on the Integrations tab.
- Click the ADD INTEGRATION drop-down and select your integration.
- Click the edit option to change the version number (if required) and enter the environment-level configuration. Leave the config untouched if it's not required.
- Click SAVE to continue.