Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 04:45 UTC
| 1 | import { Composio } from '@composio/core'; |
| 2 | |
| 3 | const composio = new Composio(); |
| 4 | |
| 5 | const toolkit = await composio.toolkits.get('gmail'); |
| 6 | console.log(toolkit); |
| 7 | |
| 8 | const connectionRequest = await composio.toolkits.authorize('default', 'gmail'); |
| 9 | console.log(connectionRequest.toJSON()); |
| 10 | |
| 11 | const redirectURL = connectionRequest.redirectUrl; |
| 12 | console.log(`Please visit the following URL to authorize the toolkit: ${redirectURL}`); |
| 13 | |
| 14 | const connectedAccount = await connectionRequest.waitForConnection(); |
| 15 | |
| 16 | console.log(connectedAccount); |