@devries-cameron20 / composio Mirror · read-only / commits / 64f7efe69
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 21, 12:15 UTC

docs: update TypeScript SDK reference from source (#4534)

## Summary Auto-generated TypeScript SDK reference docs from `ts/packages/core/src/`. Regenerates pages at `docs/content/reference/sdk-reference/typescript/` to reflect changes in the core package's public API (new methods, updated signatures, changed types). Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>

sdkrelease[bot] committed Sep 21, 2026 at 15:37 UTC 64f7efe69df7feacbd8808e236cf9fe0c8e86d93
1 file changed +46 -3
docs/content/reference/sdk-reference/typescript/session.mdx
+46 -3
@@ -7,6 +7,7 @@ description: "A Composio session — the object returned by `composio.sessions.c
7
8 | Name | Type | Description |
9 |------|------|-------------|
10 +| `config` | `Config` | Server-side session configuration (toolkit/tool allowlists, tags, preload, sandbox, manage_connections) as returned by the API. Refreshed in place by `update()`. |
11 | `configVersion` | `number` | |
12 | `experimental` | `SessionExperimental` | |
13 | `mcp` | `\{ headers?: Record<string, string>; type: 'http' \| 'sse'; url: string \}` | Hosted MCP endpoint (`session.mcp.url` / `session.mcp.headers`). Exists on every session at runtime, but only surfaced in the type when the session is created with `\{ mcp: true \}` (which returns `Session`); the default `SessionWithoutMcp` omits `mcp`, so MCP is an explicit opt-in. See https://docs.composio.dev/docs/sessions-via-mcp |
@@ -110,6 +111,47 @@ async delete(requestOptions?: ComposioRequestOptions): Promise<ToolRouterSession
111
112 ---
113
114 +### ensureConnected()
115 +
116 +Ensure a toolkit has an active connection in this session, reconciling
117 +`authorize()`/`session.link` with the session's active connection state.
118 +
119 +If the session already resolves an ACTIVE connection (or the toolkit is
120 +no-auth), this returns immediately without creating a link — unlike
121 +`authorize()`, which always starts a new link flow, even when one is
122 +already connected. Otherwise it starts the authorization flow and waits
123 +for the new connection to become ACTIVE.
124 +
125 +For interactive flows that should surface the redirect URL instead of
126 +blocking, use `authorize()` and its `waitForConnection()` directly.
127 +
128 +```typescript
129 +async ensureConnected(toolkit: string, options?: ToolRouterSessionEnsureConnectedOptions, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionEnsureConnectedResult>
130 +```
131 +
132 +**Parameters**
133 +
134 +| Name | Type | Description |
135 +|------|------|-------------|
136 +| `toolkit` | `string` | The toolkit slug to ensure a connection for (e.g. 'github') |
137 +| `options?` | `ToolRouterSessionEnsureConnectedOptions` | Optional authorization options plus `timeout` (ms to wait for a newly-initiated connection, default 60000) |
138 +| `requestOptions?` | `ComposioRequestOptions` | |
139 +
140 +**Returns**
141 +
142 +`Promise<ToolRouterSessionEnsureConnectedResult>` — The toolkit's canonical slug, whether it was already connected,
143 + and the active connected account (omitted for no-auth toolkits)
144 +
145 +**Example**
146 +
147 +```typescript
148 +const session = await composio.sessions.create({ toolkits: ['github'] });
149 +const { wasConnected, connectedAccount } = await session.ensureConnected('github');
150 +if (!wasConnected) console.log('Newly linked:', connectedAccount?.id);
151 +```
152 +
153 +---
154 +
155 ### execute()
156
157 Execute a tool within the session.
@@ -233,10 +275,11 @@ async tools(modifiers?: SessionMetaToolOptions, requestOptions?: ComposioRequest
275
276 Partially update the session configuration.
277 Only the fields provided will be changed; omitted fields are preserved.
236 -Mutates this session's `configVersion`, `preload`, and `warnings` in-place.
278 +Mutates this session's `config`, `configVersion`, `preload`, `sandbox`,
279 +and `warnings` in-place, and resolves to the updated session `config`.
280
281 ```typescript
239 -async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<void>
282 +async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionConfig>
283 ```
284
285 **Parameters**
@@ -248,6 +291,6 @@ async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioReq
291
292 **Returns**
293
251 -`Promise<void>`
294 +`Promise<ToolRouterSessionConfig>`
295
296 ---