Composio
@composio/core / composio / Composio
Class: Composio<TProvider>
Defined in: ts/packages/core/src/composio.ts:121
This is the core class for Composio. It is used to initialize the Composio SDK and provide a global configuration.
Type Parameters
TProvider
TProvider
extends BaseComposioProvider
<unknown
, unknown
, unknown
> = OpenAIProvider
Constructors
Constructor
new Composio<
TProvider
>(config?
):Composio
<TProvider
>
Defined in: ts/packages/core/src/composio.ts:192
Creates a new instance of the Composio SDK.
The constructor initializes the SDK with the provided configuration options, sets up the API client, and initializes all core models (tools, toolkits, etc.).
Parameters
config?
ComposioConfig
<TProvider
>
Configuration options for the Composio SDK
Returns
Composio
<TProvider
>
Example
Properties
authConfigs
authConfigs:
AuthConfigs
Defined in: ts/packages/core/src/composio.ts:144
client
protected
client:Composio
Defined in: ts/packages/core/src/composio.ts:128
The Composio API client.
connectedAccounts
connectedAccounts:
ConnectedAccounts
Defined in: ts/packages/core/src/composio.ts:145
deprecated
deprecated:
object
Defined in: ts/packages/core/src/composio.ts:158
Deprecated features
mcp
mcp:
MCP
<TProvider
>
experimental
experimental:
object
Defined in: ts/packages/core/src/composio.ts:151
Experimental features
toolRouter
toolRouter:
ToolRouter
files
files:
Files
Defined in: ts/packages/core/src/composio.ts:143
mcp
mcp:
MCP
Defined in: ts/packages/core/src/composio.ts:146
provider
provider:
TProvider
Defined in: ts/packages/core/src/composio.ts:142
toolkits
toolkits:
Toolkits
Defined in: ts/packages/core/src/composio.ts:140
tools
tools:
Tools
<unknown
,unknown
,TProvider
>
Defined in: ts/packages/core/src/composio.ts:139
Core models for Composio.
triggers
triggers:
Triggers
Defined in: ts/packages/core/src/composio.ts:141
Methods
createSession()
createSession(
options?
):Composio
<TProvider
>
Defined in: ts/packages/core/src/composio.ts:342
Creates a new instance of the Composio SDK with custom request options while preserving the existing configuration. This method is particularly useful when you need to:
- Add custom headers for specific requests
- Track request contexts with unique identifiers
- Override default request behavior for a subset of operations
The new instance inherits all configuration from the parent instance (apiKey, baseURL, provider, etc.) but allows you to specify custom request options that will be used for all API calls made through this session.
Parameters
options?
headers?
ComposioRequestHeaders
Returns
Composio
<TProvider
>
A new Composio instance with the custom request options applied.
Example
getClient()
getClient():
Composio
Defined in: ts/packages/core/src/composio.ts:293
Get the Composio SDK client.
Returns
Composio
The Composio API client.
getConfig()
getConfig():
ComposioConfig
<TProvider
>
Defined in: ts/packages/core/src/composio.ts:304
Get the configuration SDK is initialized with
Returns
ComposioConfig
<TProvider
>
The configuration SDK is initialized with