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
- Default Configuration
- With API Key
- With Custom Provider
- With Toolkit Versions
- Full Configuration
Properties
TheComposio instance provides access to core functionality through these properties:
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.
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.
use()
Use an existing tool router session.string
required
The ID of the session to use.
getClient()
Get the underlying Composio API client.getConfig()
Get the configuration used to initialize the SDK.createSession() Deprecated
Create a new instance with custom request options.flush()
Flush pending telemetry data. Required in environments like Cloudflare Workers that don’t support process exit events.Type Parameters
TheComposio 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