Using custom auth configuration

Markdown

Some toolkits don't have Composio managed authentication and require you to provide your own credentials. When sessions try to use these toolkits, an error will be thrown asking you to create an auth config.

Check if a toolkit needs custom credentials

In the Composio platform, go to "All Toolkits" and select the toolkit. If it shows no Composio managed auth schemes, you'll need to create an auth config.

Create an auth config

  1. Go to Authentication management in the dashboard
  2. Click Create Auth Config
  3. Select the toolkit
  4. Choose the auth scheme (OAuth2, API Key, etc.)
  5. Enter your credentials (client ID, client secret, API key, etc.)
  6. Click Create

Copy the auth config ID (e.g., ac_1234abcd).

For detailed instructions on getting credentials for specific toolkits, see Custom auth configs.

Use in your session

Pass your auth config ID when creating a session:

session = composio.create(
    user_id="user_123",
    auth_configs={
        "posthog": "ac_your_posthog_config"
    }
)
const session = await composio.create("user_123", {
  authConfigs: {
    posthog: "ac_your_posthog_config",
  },
});

Your session will now use this auth config when users connect to this toolkit.