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, 21:00 UTC
docs: use `session` consistently when rehydrating with composio.use()
The TypeScript samples in the changelog and provider docs declared the rehydrated session as `session2`, which is misleading — it's the same logical session, just being recreated from a stored ID. Rename to `session` to match the Python samples and add `// @noErrors` so twoslash ignores the redeclaration (these blocks are illustrative, not runnable). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: abir <abir@composio.dev>
Zen Agent committed
May 8, 2026 at 23:40 UTC
276b9521b623467b93493deffcd4090f2ae56498
4 files changed
+12
-8
docs/content/changelog/05-08-26-session-use-update-connected-accounts.mdx
+3
-2
@@ -26,6 +26,7 @@ tools = session.tools()
26
</Tab>
27
<Tab value="TypeScript">
28
```typescript
29
+// @noErrors
30
import { Composio } from '@composio/core';
31
const composio = new Composio({ apiKey: 'your_api_key' });
32
// ---cut---
@@ -34,8 +35,8 @@ const session = await composio.create("user_123");
35
const sessionId = session.sessionId;
36
37
// Subsequent requests
37
-const session2 = await composio.use(sessionId);
38
-const tools = await session2.tools();
38
+const session = await composio.use(sessionId);
39
+const tools = await session.tools();
40
```
41
</Tab>
42
</Tabs>
docs/content/docs/providers/anthropic.mdx
+3
-2
@@ -172,6 +172,7 @@ tools = session.tools()
172
</Tab>
173
<Tab value="TypeScript">
174
```typescript
175
+// @noErrors
176
import { Composio } from '@composio/core';
177
const composio = new Composio({ apiKey: 'your_api_key' });
178
// ---cut---
@@ -181,8 +182,8 @@ const sessionId = session.sessionId;
182
// store sessionId in your database or chat state
183
184
// Subsequent requests — reuse the session
184
-const session2 = await composio.use(sessionId);
185
-const tools = await session2.tools();
185
+const session = await composio.use(sessionId);
186
+const tools = await session.tools();
187
```
188
</Tab>
189
</Tabs>
docs/content/docs/providers/openai.mdx
+3
-2
@@ -321,6 +321,7 @@ tools = session.tools()
321
</Tab>
322
<Tab value="TypeScript">
323
```typescript
324
+// @noErrors
325
import { Composio } from '@composio/core';
326
const composio = new Composio({ apiKey: 'your_api_key' });
327
// ---cut---
@@ -330,8 +331,8 @@ const sessionId = session.sessionId;
331
// store sessionId in your database or chat state
332
333
// Subsequent requests — reuse the session
333
-const session2 = await composio.use(sessionId);
334
-const tools = await session2.tools();
334
+const session = await composio.use(sessionId);
335
+const tools = await session.tools();
336
```
337
</Tab>
338
</Tabs>
docs/content/docs/providers/vercel.mdx
+3
-2
@@ -62,6 +62,7 @@ console.log(text);
62
For multi-turn apps, create the session once and reuse it across requests with `composio.use()`:
63
64
```typescript
65
+// @noErrors
66
import { anthropic } from "@ai-sdk/anthropic";
67
import { Composio } from "@composio/core";
68
import { VercelProvider } from "@composio/vercel";
@@ -75,8 +76,8 @@ const sessionId = session.sessionId;
76
// store sessionId in your database or chat state
77
78
// Subsequent requests — reuse the session
78
-const session2 = await composio.use(sessionId);
79
-const tools = await session2.tools();
79
+const session = await composio.use(sessionId);
80
+const tools = await session.tools();
81
82
const { text } = await generateText({
83
model: anthropic("claude-opus-4-6"),