> ## Documentation Index
> Fetch the complete documentation index at: https://docs.membrane.agency/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 ui.connect()

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

```javascript theme={null}
await membrane.ui.connect({
  integrationKey: 'hubspot',
  connectorParameters: {
    scopes: ['contacts', 'deals', 'companies'], // Custom OAuth scopes
  },
})
```

<br />

## Method 2: Using connect()

For programmatic connection creation with custom parameters:

```javascript theme={null}
const connection = await membrane.integration('hubspot').connect({
  input: {
    // User-provided connection input
    apiKey: 'user-api-key',
  },
  connectorParameters: {
    // Developer-provided connector customizations
    scopes: ['contacts', 'deals', 'companies'],
  },
})
```

<br />

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

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

### HTML Form Example

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