Create an Integration

Create a custom Integration with which Connections can be created. To create a new Integration, you must provide your own application authentication parameters.

πŸ“˜

Learn More about Custom Integrations

https://help.catalytic.com/docs/custom-integrations/

Method Signature

create(createRequest: IntegrationCreationRequest): Promise<Integration>;
create(name: string, config: IntegrationConfiguration): Promise<Integration>;
create(createRequest: IntegrationCreationRequest, callback: ClientMethodCallback<Integration>): Promise<Integration>;
create(name: string, config: IntegrationConfiguration, callback: ClientMethodCallback<Integration>): Promise<Integration>;

Parameters

ParameterTypeDescription
creationRequestIntegrationCreationRequestThe request containing Integration configuration metadata
returnsIntegrationThe requested Integration

IntegrationCreationRequest

NameTypeDescription
namestringThe display Name to apply to the Integration
configIntegrationConfigurationThe configuration settings for the Integration

IntegrationConfiguration

NameTypeDescription
clientIdstringClient ID of the OAuth Application
clientSecretstringClient Secret of the OAuth Application
tokenPathstringToken Path of the OAuth Application
revokePathstringToken Revocation Path of the OAuth Application
authorizeBaseUrlstringThe base URL of the OAuth Application
sitestringThe website of the OAuth Application
scopesstring[]The list of Scopes to apply to Connections using the Integration
useBodyAuthbooleanBoolean indicating whether auth params should be sent to OAuth app in body

Example

/*
 * This example demonstrates creating a custom Integration
 */

const { CatalyticClient } = require('@catalytic/sdk');

const catalytic = new CatalyticClient();

const name = 'My Custom Integration';

const config = {
    clientID: 'MY_OAUTH_CLIENT_ID',
    clientSecret: 'MY_OAUTH_CLIENT_SECRET',
    tokenPath: '/oauth2/token',
    revokePath: '/oauth2/revoke',
    authorizeBaseUrl: 'https://example-oauth-app.com/oauth2/authorize',
    site: 'https://api.example-oauth-app.com',
    scopes: ['read', 'write'],
    useBodyAuth: false
};

const integration = await catalytic.integration.create(name, config);
console.log(integration.id);