Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { Composio } from '@composio/core'; |
| 2 | |
| 3 | const composio = new Composio({ |
| 4 | apiKey: process.env.COMPOSIO_API_KEY, |
| 5 | }); |
| 6 | |
| 7 | const authConfigId = process.env.COMPOSIO_EXAMPLES_GMAIL_AUTH_CONFIG_ID; // your auth config ID |
| 8 | if (!authConfigId) { |
| 9 | throw new Error('Set COMPOSIO_EXAMPLES_GMAIL_AUTH_CONFIG_ID'); |
| 10 | } |
| 11 | |
| 12 | const connectionRequest = await composio.connectedAccounts.initiate('default', authConfigId, { |
| 13 | allowMultiple: true, |
| 14 | }); |
| 15 | |
| 16 | console.log(connectionRequest.redirectUrl); |