@devries-cameron20 / composio Mirror · read-only / commits / 190b2702e
Fork 0

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 23, 03:00 UTC

Fix examples

haxzie committed May 16, 2025 at 19:42 UTC 190b2702e7292338a0ff34382e3cd44dbeba0bb6
7 files changed +20 -14
examples/connected-accounts/src/index.ts
-2
@@ -21,8 +21,6 @@ const authConfig = await composio.createAuthConfig('my-toolkit', {
21 /**
22 * Create a new connected account
23 */
24 -// hmm so the createConnectedAccount here doesn't feel like i am initiating a connection request -> that is probably why it was called initiateConnection
25 -// connectedAccounts.initiate or initialize work
24 const ConnectionRequest = await composio.initiateConnection('default', authConfig.id);
25 const connectedAccount = await ConnectionRequest.waitForConnection();
26
examples/connected-accounts/src/toolkit-authorize.ts
+11 -3
@@ -6,14 +6,22 @@ const composio = new Composio({
6 apiKey: process.env.COMPOSIO_API_KEY,
7 });
8
9 -// magic flow
9 +/**
10 + * This is a coumpound flow which will initiate a connection request and wait for the user to authorize the toolkit
11 + */
12 const connectionRequest = await composio.toolkits.authorize('default', 'github');
13 const redirectUrl = connectionRequest.redirectUrl;
12 -// app requires user to visit the following URL to authorize the toolkit
14 +/**
15 + * If the redirectUrl is not null, it means that the user needs to visit the following URL to authorize the toolkit
16 + */
17 if (redirectUrl) {
18 console.log(`⚠️ Please visit the following URL to authorize the toolkit: ${redirectUrl}`);
19 }
16 -console.log('Waiting for connection...');
20 +console.log('🔄 Waiting for connection...');
21 +/**
22 + * This will wait for the user to authorize the toolkit and then return the connected account
23 + * Optionally, you can pass a timeout to the waitForConnection method
24 + */
25 const connectedAccount = await connectionRequest.waitForConnection();
26 console.log(`✅ Connected account created: ${connectedAccount.id}`);
27 console.log(connectedAccount);
packages/core/package.json
+1 -1
@@ -41,5 +41,5 @@
41 "zod": "^3.24.2",
42 "zod-to-json-schema": "^3.24.5"
43 },
44 - "gitHead": "1f47c2a021338479c261ccde1ac6eb538ead47fd"
44 + "gitHead": "f1d3e98644b917030fe9b4cc43db84d21934894a"
45 }
packages/toolsets/cloudflare/package.json
+2 -2
@@ -33,9 +33,9 @@
33 "@composio/core": "^0.1.9-alpha.0"
34 },
35 "devDependencies": {
36 - "@composio/core": "workspace:*",
36 + "@composio/core": "0.1.9-alpha.0",
37 "tsup": "^8.4.0",
38 "typescript": "^5.8.3"
39 },
40 - "gitHead": "1f47c2a021338479c261ccde1ac6eb538ead47fd"
40 + "gitHead": "f1d3e98644b917030fe9b4cc43db84d21934894a"
41 }
packages/toolsets/langchain/package.json
+2 -2
@@ -33,9 +33,9 @@
33 "@langchain/core": "^0.3.44"
34 },
35 "devDependencies": {
36 - "@composio/core": "workspace:*",
36 + "@composio/core": "0.1.9-alpha.0",
37 "tsup": "^8.4.0",
38 "typescript": "^5.8.3"
39 },
40 - "gitHead": "1f47c2a021338479c261ccde1ac6eb538ead47fd"
40 + "gitHead": "f1d3e98644b917030fe9b4cc43db84d21934894a"
41 }
packages/toolsets/openai/package.json
+2 -2
@@ -33,9 +33,9 @@
33 "openai": "^4.3.8"
34 },
35 "devDependencies": {
36 - "@composio/core": "workspace:*",
36 + "@composio/core": "0.1.9-alpha.0",
37 "tsup": "^8.4.0",
38 "typescript": "^5.8.3"
39 },
40 - "gitHead": "1f47c2a021338479c261ccde1ac6eb538ead47fd"
40 + "gitHead": "f1d3e98644b917030fe9b4cc43db84d21934894a"
41 }
packages/toolsets/vercel/package.json
+2 -2
@@ -33,9 +33,9 @@
33 "ai": "^4.3.8"
34 },
35 "devDependencies": {
36 - "@composio/core": "workspace:*",
36 + "@composio/core": "0.1.9-alpha.0",
37 "tsup": "^8.4.0",
38 "typescript": "^5.8.3"
39 },
40 - "gitHead": "1f47c2a021338479c261ccde1ac6eb538ead47fd"
40 + "gitHead": "f1d3e98644b917030fe9b4cc43db84d21934894a"
41 }