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 | /** |
| 2 | * Versioning Example |
| 3 | * |
| 4 | * This example demonstrates how to use Composio SDK for versioning. |
| 5 | * |
| 6 | * Prerequisites: |
| 7 | * 1. Set up your COMPOSIO_API_KEY in the .env file |
| 8 | * 3. Run the example: pnpm start |
| 9 | */ |
| 10 | |
| 11 | import { Composio } from '@composio/core'; |
| 12 | import 'dotenv/config'; |
| 13 | |
| 14 | /** |
| 15 | * Initialize Composio |
| 16 | */ |
| 17 | const composio = new Composio({ |
| 18 | apiKey: process.env.COMPOSIO_API_KEY, |
| 19 | }); |
| 20 | |
| 21 | const config = composio.getConfig() |
| 22 | console.log(JSON.stringify(config, null, 2)) |
| 23 | |
| 24 | /** |
| 25 | * Main function to run the example |
| 26 | */ |
| 27 | async function main() { |
| 28 | try { |
| 29 | console.log('🚀 Starting Versioning Example...'); |
| 30 | |
| 31 | // Get available tools |
| 32 | const tools = await composio.tools.get('default', { |
| 33 | // Specify the apps you want to use |
| 34 | toolkits: ['gmail', 'googlecalendar'], |
| 35 | limit: 10, |
| 36 | }); |
| 37 | |
| 38 | console.log(`✅ Found ${tools.length} tools`); |
| 39 | |
| 40 | // TODO: Add your example implementation here |
| 41 | console.log('📝 Implement your versioning logic here!'); |
| 42 | |
| 43 | } catch (error) { |
| 44 | console.error('❌ Error running example:', error); |
| 45 | process.exitCode = 1; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | // Run the example |
| 50 | main().catch(error => { |
| 51 | console.error(error); |
| 52 | process.exitCode = 1; |
| 53 | }); |