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, 11:00 UTC
docs: auto-generate TypeScript SDK reference
jkomyno committed
Sep 29, 2026 at 15:28 UTC
27da50d05542ae07502f5e3c110f34c42bca8764
3 files changed
+11
-11
docs/content/reference/sdk-reference/typescript/logs.mdx
+4
-4
@@ -20,7 +20,7 @@ Retrieve one tool-execution log with its full detail (timings, context,
20
source and raw `data`).
21
22
```typescript
23
-async get(id: string, requestOptions?: ComposioRequestOptions): Promise<{ context: { requestId?: string; sessionId?: string; traceId?: string }; data: Record<string, unknown>; id: string; level: 'error' | 'warn' | 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: { logId: string; toolSlug: string } | null; source: { framework?: string; host?: string; language?: string }; status: 'success' | 'failed'; timestamp: string; timings?: { endTime: number; startTime: number }; type: string }>
23
+async get(id: string, requestOptions?: ComposioRequestOptions): Promise<{ context: { requestId?: string; sessionId?: string; traceId?: string }; data: Record<string, unknown>; id: string; level: 'error' | 'warn' | 'info'; message?: string; metadata: { instant_charge?: string } & object; metrics: Record<string, unknown>; parent: { logId: string; toolSlug: string } | null; source: { framework?: string; host?: string; language?: string }; status: 'success' | 'failed'; timestamp: string; timings?: { endTime: number; startTime: number }; type: string }>
24
```
25
26
**Parameters**
@@ -32,7 +32,7 @@ async get(id: string, requestOptions?: ComposioRequestOptions): Promise<{ contex
32
33
**Returns**
34
35
-`Promise<\{ context: \{ requestId?: string; sessionId?: string; traceId?: string \}; data: Record<string, unknown>; id: string; level: 'error' \| 'warn' \| 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: \{ logId: string; toolSlug: string \} \| null; source: \{ framework?: string; host?: string; language?: string \}; status: 'success' \| 'failed'; timestamp: string; timings?: \{ endTime: number; startTime: number \}; type: string \}>` — The log detail
35
+`Promise<\{ context: \{ requestId?: string; sessionId?: string; traceId?: string \}; data: Record<string, unknown>; id: string; level: 'error' \| 'warn' \| 'info'; message?: string; metadata: \{ instant_charge?: string \} & object; metrics: Record<string, unknown>; parent: \{ logId: string; toolSlug: string \} \| null; source: \{ framework?: string; host?: string; language?: string \}; status: 'success' \| 'failed'; timestamp: string; timings?: \{ endTime: number; startTime: number \}; type: string \}>` — The log detail, with an optional exact USD charge in `metadata.instant_charge`
36
37
**Example**
38
@@ -49,7 +49,7 @@ Search tool-execution logs with filters, a time range and cursor
49
pagination.
50
51
```typescript
52
-async search(params?: { cursor?: string | null; filters?: { field: 'status' | 'tool_slug' | 'toolkit_slug' | 'connected_account_id' | 'auth_config_id' | 'user_id' | 'session_id' | 'sandbox_id' | 'request_id' | 'log_id'; operator: '==' | '!=' | 'contains' | 'not_contains'; value: string }[]; limit?: number; timeRange?: { from: number; to: number } }, requestOptions?: ComposioRequestOptions): Promise<{ logs: { id: string; level: 'error' | 'warn' | 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: { logId: ...; toolSlug: ... } | null; status: 'success' | 'failed'; timestamp: string; type: string }[]; nextCursor: string | null }>
52
+async search(params?: { cursor?: string | null; filters?: { field: 'status' | 'tool_slug' | 'toolkit_slug' | 'connected_account_id' | 'auth_config_id' | 'user_id' | 'session_id' | 'sandbox_id' | 'request_id' | 'log_id'; operator: '==' | '!=' | 'contains' | 'not_contains'; value: string }[]; limit?: number; timeRange?: { from: number; to: number } }, requestOptions?: ComposioRequestOptions): Promise<{ logs: { id: string; level: 'error' | 'warn' | 'info'; message?: string; metadata: { instant_charge?: ... } & object; metrics: Record<string, unknown>; parent: { logId: ...; toolSlug: ... } | null; status: 'success' | 'failed'; timestamp: string; type: string }[]; nextCursor: string | null }>
53
```
54
55
**Parameters**
@@ -61,7 +61,7 @@ async search(params?: { cursor?: string | null; filters?: { field: 'status' | 't
61
62
**Returns**
63
64
-`Promise<\{ logs: \{ id: string; level: 'error' \| 'warn' \| 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: \{ logId: ...; toolSlug: ... \} \| null; status: 'success' \| 'failed'; timestamp: string; type: string \}[]; nextCursor: string \| null \}>` — Matching logs and the next cursor
64
+`Promise<\{ logs: \{ id: string; level: 'error' \| 'warn' \| 'info'; message?: string; metadata: \{ instant_charge?: ... \} & object; metrics: Record<string, unknown>; parent: \{ logId: ...; toolSlug: ... \} \| null; status: 'success' \| 'failed'; timestamp: string; type: string \}[]; nextCursor: string \| null \}>` — Matching logs and the next cursor. Charged calls include `metadata.instant_charge` as an exact USD string.
65
66
**Example**
67
docs/content/reference/sdk-reference/typescript/session.mdx
+5
-5
@@ -7,7 +7,7 @@ description: "A Composio session — the object returned by `composio.sessions.c
7
8
| Name | Type | Description |
9
|------|------|-------------|
10
-| `config` | `Config` | The session's current configuration (policy snapshot and runtime settings). Refreshed in place by `update()`. For saved, reusable Session configs, see `composio.sessionConfigs`. |
10
+| `config` | `ToolRouterSessionConfig` | The session's current configuration (policy snapshot and runtime settings). Refreshed in place by `update()`. For saved, reusable Session configs, see `composio.sessionConfigs`. |
11
| `configVersion` | `number` | Version of the server-side configuration this object last observed. Refreshed in place by `update()`. Pass it as `expectedConfigVersion` to make an update conditional. |
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 |
@@ -239,7 +239,7 @@ Search for tools by semantic use case.
239
Returns relevant tools for the given query with schemas and guidance.
240
241
```typescript
242
-async search(params: { query: string; toolkits?: string[] }, requestOptions?: ComposioRequestOptions): Promise<{ error: string | null; nextStepsGuidance: string[]; results: { difficulty?: string; error?: string | null; executionGuidance?: string; index: number; knownPitfalls?: string[]; memory?: Record<string, ...[]>; planId?: string; primaryToolSlugs: string[]; recommendedPlanSteps?: string[]; referenceWorkbenchSnippets?: { code: ...; description: ... }[]; relatedToolSlugs: string[]; toolkits: string[]; useCase: string }[]; session: { generateId: boolean; id: string; instructions: string }; success: boolean; timeInfo: { currentTimeUtc: string; currentTimeUtcEpochSeconds: number; message: string }; toolkitConnectionStatuses: { connectionDetails?: Record<string, unknown>; currentUserInfo?: Record<string, unknown>; description: string; hasActiveConnection: boolean; hostedAccount?: { allowedToolSlugs: ...[] }; statusMessage: string; toolkit: string }[]; toolSchemas: Record<string, { description?: string; hasFullSchema?: boolean; inputSchema?: Record<string, unknown>; outputSchema?: Record<string, unknown>; schemaRef?: { args: { toolSlugs: ... }; message?: string; tool: 'COMPOSIO_GET_TOOL_SCHEMAS' }; toolkit: string; toolSlug: string }> }>
242
+async search(params: { query: string; toolkits?: string[] }, requestOptions?: ComposioRequestOptions): Promise<{ error: string | null; nextStepsGuidance: string[]; results: { difficulty?: string; error?: string | null; executionGuidance?: string; index: number; knownPitfalls?: string[]; memory?: Record<string, ...[]>; planId?: string; primaryToolSlugs: string[]; recommendedPlanSteps?: string[]; referenceWorkbenchSnippets?: { code: ...; description: ... }[]; relatedToolSlugs: string[]; toolkits: string[]; useCase: string }[]; session: { generateId: boolean; id: string; instructions: string }; success: boolean; timeInfo: { currentTimeUtc: string; currentTimeUtcEpochSeconds: number; message: string }; toolkitConnectionStatuses: { connectionDetails?: Record<string, unknown>; currentUserInfo?: Record<string, unknown>; description: string; hasActiveConnection: boolean; instantAccount?: { allowedToolSlugs: ...[] }; statusMessage: string; toolkit: string }[]; toolSchemas: Record<string, { description?: string; hasFullSchema?: boolean; inputSchema?: Record<string, unknown>; outputSchema?: Record<string, unknown>; schemaRef?: { args: { toolSlugs: ... }; message?: string; tool: 'COMPOSIO_GET_TOOL_SCHEMAS' }; toolkit: string; toolSlug: string }> }>
243
```
244
245
**Parameters**
@@ -251,7 +251,7 @@ async search(params: { query: string; toolkits?: string[] }, requestOptions?: Co
251
252
**Returns**
253
254
-`Promise<\{ error: string \| null; nextStepsGuidance: string[]; results: \{ difficulty?: string; error?: string \| null; executionGuidance?: string; index: number; knownPitfalls?: string[]; memory?: Record<string, ...[]>; planId?: string; primaryToolSlugs: string[]; recommendedPlanSteps?: string[]; referenceWorkbenchSnippets?: \{ code: ...; description: ... \}[]; relatedToolSlugs: string[]; toolkits: string[]; useCase: string \}[]; session: \{ generateId: boolean; id: string; instructions: string \}; success: boolean; timeInfo: \{ currentTimeUtc: string; currentTimeUtcEpochSeconds: number; message: string \}; toolkitConnectionStatuses: \{ connectionDetails?: Record<string, unknown>; currentUserInfo?: Record<string, unknown>; description: string; hasActiveConnection: boolean; hostedAccount?: \{ allowedToolSlugs: ...[] \}; statusMessage: string; toolkit: string \}[]; toolSchemas: Record<string, \{ description?: string; hasFullSchema?: boolean; inputSchema?: Record<string, unknown>; outputSchema?: Record<string, unknown>; schemaRef?: \{ args: \{ toolSlugs: ... \}; message?: string; tool: 'COMPOSIO_GET_TOOL_SCHEMAS' \}; toolkit: string; toolSlug: string \}> \}>`
254
+`Promise<\{ error: string \| null; nextStepsGuidance: string[]; results: \{ difficulty?: string; error?: string \| null; executionGuidance?: string; index: number; knownPitfalls?: string[]; memory?: Record<string, ...[]>; planId?: string; primaryToolSlugs: string[]; recommendedPlanSteps?: string[]; referenceWorkbenchSnippets?: \{ code: ...; description: ... \}[]; relatedToolSlugs: string[]; toolkits: string[]; useCase: string \}[]; session: \{ generateId: boolean; id: string; instructions: string \}; success: boolean; timeInfo: \{ currentTimeUtc: string; currentTimeUtcEpochSeconds: number; message: string \}; toolkitConnectionStatuses: \{ connectionDetails?: Record<string, unknown>; currentUserInfo?: Record<string, unknown>; description: string; hasActiveConnection: boolean; instantAccount?: \{ allowedToolSlugs: ...[] \}; statusMessage: string; toolkit: string \}[]; toolSchemas: Record<string, \{ description?: string; hasFullSchema?: boolean; inputSchema?: Record<string, unknown>; outputSchema?: Record<string, unknown>; schemaRef?: \{ args: \{ toolSlugs: ... \}; message?: string; tool: 'COMPOSIO_GET_TOOL_SCHEMAS' \}; toolkit: string; toolSlug: string \}> \}>`
255
256
---
257
@@ -338,7 +338,7 @@ for example for an archived or missing config, surface unchanged.
338
successful response, and the updated `config` is returned.
339
340
```typescript
341
-async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<Config>
341
+async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionConfig>
342
```
343
344
**Parameters**
@@ -350,6 +350,6 @@ async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioReq
350
351
**Returns**
352
353
-`Promise<Config>`
353
+`Promise<ToolRouterSessionConfig>`
354
355
---
docs/content/reference/sdk-reference/typescript/usage.mdx
+2
-2
@@ -52,7 +52,7 @@ Usage totals per metering entity type for a time range.
52
**Experimental — shape may change in future releases.**
53
54
```typescript
55
-async summary(params?: { entityTypes?: string[]; filters?: { sessionId?: string[] | null; userId?: string[] | null }; from?: number; to?: number }, requestOptions?: ComposioRequestOptions): Promise<{ entities: Record<string, { eventCount: number; totalQuantity: string; unit: string }> }>
55
+async summary(params?: { entityTypes?: string[]; filters?: { sessionId?: string[] | null; userId?: string[] | null }; from?: number; to?: number }, requestOptions?: ComposioRequestOptions): Promise<...>
56
```
57
58
**Parameters**
@@ -64,7 +64,7 @@ async summary(params?: { entityTypes?: string[]; filters?: { sessionId?: string[
64
65
**Returns**
66
67
-`Promise<...>` — Totals keyed by entity type
67
+`Promise<...>` — Totals keyed by entity type and the exact USD Instant charge
68
69
**Example**
70