Skip to main content
The Composio class is the entry point for the TypeScript SDK. It initializes the API client and provides access to all core functionality.

Constructor

Parameters

ComposioConfig<TProvider>
Configuration options for the SDK

Examples

Properties

The Composio instance provides access to core functionality through these properties:
Tools
List, retrieve, and execute tools. See Tools API.
Toolkits
Retrieve toolkit metadata and manage connections. See Toolkits API.
ConnectedAccounts
Manage user authentication. See Connected Accounts API.
AuthConfigs
Manage authentication configurations. See Auth Configs API.
Triggers
Manage webhook triggers. See Triggers API.
TProvider
The configured provider instance for wrapping tools.
Files
Upload and download files.
MCP
Model Context Protocol server management. See MCP.
ToolRouter
Experimental: Intelligent tool routing and connection management. See Tool Router.

Methods

create()

Create a new tool router session for a user.
string
required
The user ID to create the session for.
ToolRouterCreateSessionConfig
Configuration for the tool router session.
Example:
See Tool Router for more details.

use()

Use an existing tool router session.
string
required
The ID of the session to use.
Example:

getClient()

Get the underlying Composio API client.
Example:

getConfig()

Get the configuration used to initialize the SDK.
Example:

createSession() Deprecated

Create a new instance with custom request options.
This method will be removed in a future version. Use defaultHeaders in the constructor instead.
Example:

flush()

Flush pending telemetry data. Required in environments like Cloudflare Workers that don’t support process exit events.
Example:

Type Parameters

The Composio class is generic and accepts a type parameter for the provider:

Environment Variables

The SDK reads these environment variables: Example:

Next Steps

Tools API

Work with tools

Toolkits API

Manage toolkits

Connected Accounts

User authentication

Providers

Choose your framework