Skip to main content

Constructor

constructor()

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 Returns Composio Example

Properties

Methods

createSession() (deprecated)

DeprecatedWill be removed in a future version of the SDK. Instead, construct a new instance directly with the headers you need: new Composio(\{ ...existingConfig, defaultHeaders \}). For one-off overrides, pass per-call requestOptions where supported.
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 Returns Composio — A new Composio instance with the custom request options applied. Example

flush()

Flush any pending telemetry and wait for it to complete. In Node.js-compatible environments, telemetry is automatically flushed on process exit. However, in environments like Cloudflare Workers that don’t support process exit events, you should call this method manually to ensure all telemetry is sent.
Returns Promise<void> — A promise that resolves when all pending telemetry has been sent. Example

getClient()

Get the Composio SDK client.
Returns ComposioClient — The Composio API client.

getConfig()

Get the configuration SDK is initialized with. Returns a frozen shallow clone — the SDK has already snapshotted configuration values such as dangerouslyAllowAutoUploadDownloadFiles, fileUploadDirs, and fileDownloadDir into its internal models, so mutating the live config object would silently no-op. Freezing makes that contract visible at the call site instead of letting the mutation appear successful.
Returns Readonly<ComposioConfig> — The frozen configuration the SDK is initialized with.