Using custom auth configuration

Markdown

You create a custom auth config when you need to provide your own credentials for a toolkit. Common reasons:

  • Toolkit has no managed auth: PostHog, Tavily, Perplexity, etc. require your own credentials
  • White-labeling: Show your app name on OAuth consent screens instead of "Composio". See White-labeling authentication
  • Rate limits: Composio's default OAuth app shares quota across all users. Your own app gets a dedicated quota
  • Custom scopes: You need permissions beyond what Composio's default app has approved
  • Custom instance: Connecting to a self-hosted or regional variant (e.g., custom Salesforce subdomain)
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.

On this page