SDK ReferenceTypeScript SDK

Toolkits

Markdown

Usage

Access this class through the composio.toolkits property:

const composio = new Composio({ apiKey: 'your-api-key' });
const result = await composio.toolkits.list();

Methods

authorize()

Authorizes a user to use a toolkit. This method will create an auth config if one doesn't exist and initiate a connection request.

async authorize(userId: string, toolkitSlug: string, authConfigId?: string): Promise<ConnectionRequest>

Parameters

NameTypeDescription
userIdstringThe user id of the user to authorize
toolkitSlugstringThe slug of the toolkit to authorize
authConfigId?string

Returns

Promise<ConnectionRequest> — The connection request object

Example

const connectionRequest = await composio.toolkits.authorize(userId, 'github');

get()

Retrieves a specific toolkit by its slug identifier.

Overload 1

async get(slug: string): Promise<...>

Parameters

NameTypeDescription
slugstringThe unique slug identifier of the toolkit to retrieve

Returns

Promise<...> — The toolkit object with detailed information

Overload 2

async get(query?: object): Promise<...>

Parameters

NameTypeDescription
query?objectThe query parameters to filter toolkits

Returns

Promise<...> — A paginated list of toolkits matching the query criteria

Example

// Get a specific toolkit
const githubToolkit = await composio.toolkits.get('github');
console.log(githubToolkit.name); // GitHub
console.log(githubToolkit.authConfigDetails); // Authentication configuration details

getAuthConfigCreationFields()

Retrieves the fields required for creating an auth config for a toolkit.

async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<...>

Parameters

NameTypeDescription
toolkitSlugstringThe slug of the toolkit to retrieve the fields for
authSchemeAuthSchemeTypeThe auth scheme to retrieve the fields for
optionsobject

Returns

Promise<...> — The fields required for creating an auth config


getConnectedAccountInitiationFields()

Retrieves the fields required for initiating a connected account for a toolkit.

async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<...>

Parameters

NameTypeDescription
toolkitSlugstringThe slug of the toolkit to retrieve the fields for
authSchemeAuthSchemeTypeThe auth scheme to retrieve the fields for
optionsobject

Returns

Promise<...> — The fields required for initiating a connected account


listCategories()

Retrieves all toolkit categories available in the Composio SDK.

This method fetches the complete list of categories from the Composio API and transforms the response to use camelCase property naming.

async listCategories(): Promise<...>

Returns

Promise<...> — The list of toolkit categories

Example

// Get all toolkit categories
const categories = await composio.toolkits.listCategories();
console.log(categories.items); // Array of category objects