Custom Connector Parameters

Custom Connector Parameters

Custom connector parameters allow you to override or extend the integration's default connector configuration on a per-connection basis. These are developer-provided values that customize how the connector behaves for specific connections.

Use Cases

Common use cases for custom connector parameters include:

  • Custom OAuth scopes for specific connection needs
  • Dynamic environment selection if you want to programmatically decide whether to use sandbox/prod environment without asking user.
  • Having different versions of connector behavior for different connections that don't require user input.

Important Notes

  • Custom connector parameters are developer-provided, not user-editable fields
  • They are stored with the connection and used for all API calls through that connection
  • They take precedence over the integration's default connector parameters
  • They are optional - connections work without them using default integration settings

Method 1: Using openNewConnection()

When you want to open the connection UI with custom connector parameters:

await integrationApp.integration("hubspot").openNewConnection({
  allowMultipleConnections: true,
  connectorParameters: {
    scopes: ["contacts", "deals", "companies"], // Custom OAuth scopes
  },
})

Method 2: Using connect()

For programmatic connection creation with custom parameters:

const connection = await integrationApp.integration("hubspot").connect({
  parameters: {
    // User-provided connection parameters
    apiKey: "user-api-key",
  },
  connectorParameters: {
    // Developer-provided connector customizations
    scopes: ["contacts", "deals", "companies"],
  },
})

Method 3: Backend connection (no front-end SDK)

For backend-to-backend integrations or when not using the frontend SDK:

HTML Form Example

<form
  method="POST"
  action="https://your-api.integration.app/connect"
  enctype="application/x-www-form-urlencoded"
>
  <input
    type="hidden"
    name="payload"
    value='{
    "integrationId": "your-integration-id",
    "connectionParameters": {"apiKey": "user-api-key"},
    "connectorParameters": {
      "scopes": ["contacts", "deals", "companies"]
    },
    "redirectUri": "https://your-backend.com/integration/callback"
  }'
  />
  <button type="submit">Connect</button>
</form>