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() (#3389)
# Description The TypeScript samples in the new session-reuse changelog and the provider docs (Anthropic, OpenAI, Vercel) named the rehydrated session `session2`, e.g. ```ts const session = await composio.create("user_123"); const sessionId = session.sessionId; const session2 = await composio.use(sessionId); const tools = await session2.tools(); ``` `session2` is misleading — it's the *same* logical session, just being rehydrated from a stored ID across two requests. The Python samples on the same pages already use `session` for both calls. This PR aligns the TS samples with that convention: ```ts const session = await composio.create("user_123"); const sessionId = session.sessionId; const session = await composio.use(sessionId); const tools = await session.tools(); ``` Each block already uses `// ---cut---` to hide the boilerplate, so the visible body now reads naturally as two distinct request handlers. The blocks are illustrative-only and do not need to compile (the `// First request` and `// Subsequent requests` comments make it clear they are different code paths), so I added `// @noErrors` (the existing twoslash convention used elsewhere, e.g. `content/reference/sdk-reference/typescript/composio.mdx`) to suppress the `2451` redeclaration error. Files changed: - `docs/content/changelog/05-08-26-session-use-update-connected-accounts.mdx` - `docs/content/docs/providers/anthropic.mdx` - `docs/content/docs/providers/openai.mdx` - `docs/content/docs/providers/vercel.mdx` Other docs that use `session2` (`configuring-sessions.mdx`, `common-faq.mdx`, `enable-and-disable-toolkits.mdx`) were left alone — those legitimately demonstrate two *different* `composio.create()` calls with different toolkit configs, where having distinct names is correct. # How did I test this PR - `bun run types:check` — passes (twoslash type-checks all TS code blocks; `// @noErrors` correctly suppresses the redeclaration warning) - `bun run scripts/validate-links.ts` — `0 errored file, 0 errors` - Manually re-read each block to confirm the rehydration flow now reads naturally without the `session2` rename. Triggered by: abir@composio.dev | Source: web Session: https://zen-api-production-4c98.up.railway.app/dashboard/#/chat/zen-5833544890eb
No changes.