Programmatic Auth Configs

View as markdown

Auth configs are created once and reused many times. However, when managing multiple toolkits, you may want to create auth configs programmatically.

  • When creating and destroying auth configs multiple times in your app's lifecycle.
  • When creating auth configs for your users' users.

OAuth2 based apps

Using Composio Default Auth

Since OAuth2 is the most common authentication type for applications, Composio provides managed auth for most OAuth2 based applications. This is to speed up development and prototyping. This means you don't have to provide your own OAuth credentials.

from composio import Composio

composio = Composio()

# Use composio managed auth
auth_config = composio.auth_configs.create(
    toolkit="github",
    options={
        "type": "use_composio_managed_auth",
    },
)
print(auth_config)
import { class Composio<TProvider extends BaseComposioProvider<unknown, unknown, unknown> = OpenAIProvider>
This is the core class for Composio. It is used to initialize the Composio SDK and provide a global configuration.
Composio
} from "@composio/core";
const const composio: Composio<OpenAIProvider>composio = new new Composio<OpenAIProvider>(config?: ComposioConfig<OpenAIProvider> | undefined): Composio<OpenAIProvider>
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.).
@paramconfig - Configuration options for the Composio SDK@paramconfig.apiKey - The API key for authenticating with the Composio API@paramconfig.baseURL - The base URL for the Composio API (defaults to production URL)@paramconfig.allowTracking - Whether to allow anonymous usage analytics@paramconfig.provider - The provider to use for this Composio instance (defaults to OpenAIProvider)@example```typescript // Initialize with default configuration const composio = new Composio(); // Initialize with custom API key and base URL const composio = new Composio({ apiKey: 'your-api-key', baseURL: 'https://api.composio.dev' }); // Initialize with custom provider const composio = new Composio({ apiKey: 'your-api-key', provider: new CustomProvider() }); ```
Composio
();
const
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.authConfigs: AuthConfigs
Manage authentication configurations for toolkits
authConfigs
.AuthConfigs.create(toolkit: string, options?: CreateAuthConfigParams): Promise<CreateAuthConfigResponse>
Create a new auth config
@paramtoolkit - Unique identifier of the toolkit@paramoptions - Options for creating a new auth config@returnsCreated auth config@exampleconst authConfig = await authConfigs.create('my-toolkit', { type: AuthConfigTypes.CUSTOM, name: 'My Custom Auth Config', authScheme: AuthSchemeTypes.API_KEY, credentials: { apiKey: '1234567890', }, });@linkhttps://docs.composio.dev/reference/auth-configs/create-auth-config
create
("GITHUB", {
name?: string | undefinedname: "GitHub", type: "use_composio_managed_auth"type: "use_composio_managed_auth", }); var console: Console
The `console` module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers. The module exports two specific components: * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. _**Warning**_: The global console object's methods are neither consistently synchronous like the browser APIs they resemble, nor are they consistently asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for more information. Example using the global `console`: ```js console.log('hello world'); // Prints: hello world, to stdout console.log('hello %s', 'world'); // Prints: hello world, to stdout console.error(new Error('Whoops, something bad happened')); // Prints error message and stack trace to stderr: // Error: Whoops, something bad happened // at [eval]:5:15 // at Script.runInThisContext (node:vm:132:18) // at Object.runInThisContext (node:vm:309:38) // at node:internal/process/execution:77:19 // at [eval]-wrapper:6:22 // at evalScript (node:internal/process/execution:76:60) // at node:internal/main/eval_string:23:3 const name = 'Will Robinson'; console.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to stderr ``` Example using the `Console` class: ```js const out = getStreamSomehow(); const err = getStreamSomehow(); const myConsole = new console.Console(out, err); myConsole.log('hello world'); // Prints: hello world, to out myConsole.log('hello %s', 'world'); // Prints: hello world, to out myConsole.error(new Error('Whoops, something bad happened')); // Prints: [Error: Whoops, something bad happened], to err const name = 'Will Robinson'; myConsole.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to err ```
@see[source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
console
.Console.log(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
(
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
);

The returned auth_config_id should be stored securely in your database for future use to be created and destroyed multiple times.

You can also provide your own authentication details. The required credentials and authScheme depend on the auth type.

Using your own OAuth2 credentials

Setting up and using your own OAuth2 credentials is the recommended way when going to production or expecting high usage.

In this example, we're using our own OAuth2 client ID and secret to create the auth config for Notion.

# Use custom auth
auth_config = composio.auth_configs.create(
    toolkit="notion",
    options={
        "name": "Notion Auth",
        "type": "use_custom_auth",
        "auth_scheme": "OAUTH2",
        "credentials": {
            "client_id": "1234567890",
            "client_secret": "1234567890",
            "oauth_redirect_uri": "https://backend.composio.dev/api/v3/toolkits/auth/callback",
        },
    },
)
print(auth_config)
const 
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.authConfigs: AuthConfigs
Manage authentication configurations for toolkits
authConfigs
.AuthConfigs.create(toolkit: string, options?: CreateAuthConfigParams): Promise<CreateAuthConfigResponse>
Create a new auth config
@paramtoolkit - Unique identifier of the toolkit@paramoptions - Options for creating a new auth config@returnsCreated auth config@exampleconst authConfig = await authConfigs.create('my-toolkit', { type: AuthConfigTypes.CUSTOM, name: 'My Custom Auth Config', authScheme: AuthSchemeTypes.API_KEY, credentials: { apiKey: '1234567890', }, });@linkhttps://docs.composio.dev/reference/auth-configs/create-auth-config
create
("NOTION", {
name?: string | undefinedname: "Notion", type: "use_custom_auth"type: "use_custom_auth", credentials: Record<string, string | number | boolean>credentials: { client_id: stringclient_id: "1234567890", client_secret: stringclient_secret: "1234567890", oauth_redirect_uri: stringoauth_redirect_uri: "https://backend.composio.dev/api/v3/toolkits/auth/callback", }, authScheme: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH"authScheme: "OAUTH2", }); var console: Console
The `console` module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers. The module exports two specific components: * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. _**Warning**_: The global console object's methods are neither consistently synchronous like the browser APIs they resemble, nor are they consistently asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for more information. Example using the global `console`: ```js console.log('hello world'); // Prints: hello world, to stdout console.log('hello %s', 'world'); // Prints: hello world, to stdout console.error(new Error('Whoops, something bad happened')); // Prints error message and stack trace to stderr: // Error: Whoops, something bad happened // at [eval]:5:15 // at Script.runInThisContext (node:vm:132:18) // at Object.runInThisContext (node:vm:309:38) // at node:internal/process/execution:77:19 // at [eval]-wrapper:6:22 // at evalScript (node:internal/process/execution:76:60) // at node:internal/main/eval_string:23:3 const name = 'Will Robinson'; console.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to stderr ``` Example using the `Console` class: ```js const out = getStreamSomehow(); const err = getStreamSomehow(); const myConsole = new console.Console(out, err); myConsole.log('hello world'); // Prints: hello world, to out myConsole.log('hello %s', 'world'); // Prints: hello world, to out myConsole.error(new Error('Whoops, something bad happened')); // Prints: [Error: Whoops, something bad happened], to err const name = 'Will Robinson'; myConsole.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to err ```
@see[source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
console
.Console.log(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
(
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
);

You can specify a custom redirect URI by including the oauth_redirect_uri parameter in the credentials object. If not provided, Composio uses the default redirect URI.

Specifying the authorized redirect URI

The process of setting up your own OAuth2 credentials usually involves generating a client ID and secret and specifying the authorized redirect URI in the OAuth configuration.

The authorized redirect URI is the URI that captures the OAuth code that is returned to the app.

While doing so, you must ensure to set the authorized redirect URI in the OAuth configuration to:

https://backend.composio.dev/api/v3/toolkits/auth/callback
Developer settings for GitHub OAuth2 app
Redirect URI for GitHub
Developer settings for Google OAuth2 app
Redirect URI for Google

Specifying scopes

Composio requests a set of appropriate default OAuth2 scopes for each toolkit wherever possible. However, you can override or modify these scopes by passing a scopes field to the credentials object.

from composio import Composio

composio = Composio()

response = composio.auth_configs.create(
    toolkit="HUBSPOT",
    options={
        "name": "HubspotConfig",
        "authScheme": "OAUTH2",
        "type": "use_composio_managed_auth",
        "credentials": {
            "scopes": "sales-email-read,tickets"
        }
    }
)

print(response.id)
import { class Composio<TProvider extends BaseComposioProvider<unknown, unknown, unknown> = OpenAIProvider>
This is the core class for Composio. It is used to initialize the Composio SDK and provide a global configuration.
Composio
} from "@composio/core";
const const composio: Composio<OpenAIProvider>composio = new new Composio<OpenAIProvider>(config?: ComposioConfig<OpenAIProvider> | undefined): Composio<OpenAIProvider>
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.).
@paramconfig - Configuration options for the Composio SDK@paramconfig.apiKey - The API key for authenticating with the Composio API@paramconfig.baseURL - The base URL for the Composio API (defaults to production URL)@paramconfig.allowTracking - Whether to allow anonymous usage analytics@paramconfig.provider - The provider to use for this Composio instance (defaults to OpenAIProvider)@example```typescript // Initialize with default configuration const composio = new Composio(); // Initialize with custom API key and base URL const composio = new Composio({ apiKey: 'your-api-key', baseURL: 'https://api.composio.dev' }); // Initialize with custom provider const composio = new Composio({ apiKey: 'your-api-key', provider: new CustomProvider() }); ```
Composio
();
const
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.authConfigs: AuthConfigs
Manage authentication configurations for toolkits
authConfigs
.AuthConfigs.create(toolkit: string, options?: CreateAuthConfigParams): Promise<CreateAuthConfigResponse>
Create a new auth config
@paramtoolkit - Unique identifier of the toolkit@paramoptions - Options for creating a new auth config@returnsCreated auth config@exampleconst authConfig = await authConfigs.create('my-toolkit', { type: AuthConfigTypes.CUSTOM, name: 'My Custom Auth Config', authScheme: AuthSchemeTypes.API_KEY, credentials: { apiKey: '1234567890', }, });@linkhttps://docs.composio.dev/reference/auth-configs/create-auth-config
create
("HUBSPOT", {
name?: string | undefinedname: "HubspotConfig", type: "use_composio_managed_auth"type: "use_composio_managed_auth", credentials?: Record<string, string | number | boolean> | undefinedcredentials: { scopes: stringscopes: "sales-email-read,tickets", }, }); var console: Console
The `console` module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers. The module exports two specific components: * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. _**Warning**_: The global console object's methods are neither consistently synchronous like the browser APIs they resemble, nor are they consistently asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for more information. Example using the global `console`: ```js console.log('hello world'); // Prints: hello world, to stdout console.log('hello %s', 'world'); // Prints: hello world, to stdout console.error(new Error('Whoops, something bad happened')); // Prints error message and stack trace to stderr: // Error: Whoops, something bad happened // at [eval]:5:15 // at Script.runInThisContext (node:vm:132:18) // at Object.runInThisContext (node:vm:309:38) // at node:internal/process/execution:77:19 // at [eval]-wrapper:6:22 // at evalScript (node:internal/process/execution:76:60) // at node:internal/main/eval_string:23:3 const name = 'Will Robinson'; console.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to stderr ``` Example using the `Console` class: ```js const out = getStreamSomehow(); const err = getStreamSomehow(); const myConsole = new console.Console(out, err); myConsole.log('hello world'); // Prints: hello world, to out myConsole.log('hello %s', 'world'); // Prints: hello world, to out myConsole.error(new Error('Whoops, something bad happened')); // Prints: [Error: Whoops, something bad happened], to err const name = 'Will Robinson'; myConsole.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to err ```
@see[source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
console
.Console.log(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
(
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
);

Other auth types

Composio supports many applications that use different authentication types like API keys, Bearer tokens, JWT and even no authentication at all.

Generating the auth config for other auth types only has minor differences:

  • use_custom_auth is used instead of use_composio_managed_auth
  • The credentials field is used to pass the authentication details
  • The authScheme field is used to specify the auth type
# Use custom auth
auth_config = composio.auth_configs.create(
    toolkit="perplexityai",
    options={
        "type": "use_custom_auth",
        "auth_scheme": "API_KEY",
        "credentials": {}
    },
)
print(auth_config)
const 
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.authConfigs: AuthConfigs
Manage authentication configurations for toolkits
authConfigs
.AuthConfigs.create(toolkit: string, options?: CreateAuthConfigParams): Promise<CreateAuthConfigResponse>
Create a new auth config
@paramtoolkit - Unique identifier of the toolkit@paramoptions - Options for creating a new auth config@returnsCreated auth config@exampleconst authConfig = await authConfigs.create('my-toolkit', { type: AuthConfigTypes.CUSTOM, name: 'My Custom Auth Config', authScheme: AuthSchemeTypes.API_KEY, credentials: { apiKey: '1234567890', }, });@linkhttps://docs.composio.dev/reference/auth-configs/create-auth-config
create
('PERPLEXITYAI', {
name?: string | undefinedname: 'Perplexity AI', type: "use_custom_auth"type: 'use_custom_auth', credentials: Record<string, string | number | boolean>credentials: {}, authScheme: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH"authScheme: 'API_KEY', }); var console: Console
The `console` module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers. The module exports two specific components: * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. _**Warning**_: The global console object's methods are neither consistently synchronous like the browser APIs they resemble, nor are they consistently asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for more information. Example using the global `console`: ```js console.log('hello world'); // Prints: hello world, to stdout console.log('hello %s', 'world'); // Prints: hello world, to stdout console.error(new Error('Whoops, something bad happened')); // Prints error message and stack trace to stderr: // Error: Whoops, something bad happened // at [eval]:5:15 // at Script.runInThisContext (node:vm:132:18) // at Object.runInThisContext (node:vm:309:38) // at node:internal/process/execution:77:19 // at [eval]-wrapper:6:22 // at evalScript (node:internal/process/execution:76:60) // at node:internal/main/eval_string:23:3 const name = 'Will Robinson'; console.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to stderr ``` Example using the `Console` class: ```js const out = getStreamSomehow(); const err = getStreamSomehow(); const myConsole = new console.Console(out, err); myConsole.log('hello world'); // Prints: hello world, to out myConsole.log('hello %s', 'world'); // Prints: hello world, to out myConsole.error(new Error('Whoops, something bad happened')); // Prints: [Error: Whoops, something bad happened], to err const name = 'Will Robinson'; myConsole.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to err ```
@see[source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
console
.Console.log(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
(
const authConfig: {
    toolkit: string;
    authScheme: string;
    id: string;
    isComposioManaged: boolean;
}
authConfig
);

Programmatically inspecting fields

In cases where you need to dynamically discover the exact field names and handle different auth schemes programmatically, you can inspect the auth config details first.

This works for all auth types.

required_fields = composio.toolkits.get_auth_config_creation_fields(
    toolkit="NOTION",
    auth_scheme="OAUTH2",
    required_only=True,
)
print(required_fields)
const 
const toolkits: {
    slug: string;
    name: string;
    meta: {
        description?: string | undefined;
        logo?: string | undefined;
        availableVersions?: string[] | undefined;
        createdAt?: string | undefined;
        updatedAt?: string | undefined;
        categories?: {
            slug: string;
            name: string;
        }[] | undefined;
        appUrl?: string | undefined;
        toolsCount?: number | undefined;
        triggersCount?: number | undefined;
    };
    isLocalToolkit: boolean;
    composioManagedAuthSchemes?: string[] | undefined;
    baseUrl?: string | undefined;
    authConfigDetails?: {
        name: string;
        mode: string;
        fields: {
            authConfigCreation: {
                required: {
                    name: string;
                    description: string;
                    type: string;
                    required: boolean;
                    displayName: string;
                    default?: string | null | undefined;
                }[];
                optional: {
                    name: string;
                    description: string;
                    type: string;
                    required: boolean;
                    displayName: string;
                    default?: string | null | undefined;
                }[];
            };
            connectedAccountInitiation: {
                required: {
                    name: string;
                    description: string;
                    type: string;
                    required: boolean;
                    displayName: string;
                    default?: string | null | undefined;
                }[];
                optional: {
                    name: string;
                    description: string;
                    type: string;
                    required: boolean;
                    displayName: string;
                    default?: string | null | undefined;
                }[];
            };
        };
        proxy?: {
            baseUrl?: string | undefined;
        } | undefined;
    }[] | undefined;
    getCurrentUserEndpoint?: string | undefined;
}
toolkits
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.toolkits: Toolkits
Retrieve toolkit metadata and authorize user connections
toolkits
.Toolkits.get(slug: string): Promise<ToolkitRetrieveResponse> (+1 overload)
Retrieves a specific toolkit by its slug identifier.
@paramslug - The unique slug identifier of the toolkit to retrieve@returnsThe toolkit object with detailed information@throws{ComposioToolNotFoundError} If no toolkit with the given slug exists@example```typescript // Get a specific toolkit const githubToolkit = await composio.toolkits.get('github'); console.log(githubToolkit.name); // GitHub console.log(githubToolkit.authConfigDetails); // Authentication configuration details ```
get
("NOTION");
// Extract field names from authConfigDetails const
const authFields: {
    name: string;
    description: string;
    type: string;
    displayName: string;
    required?: boolean | undefined;
    default?: string | null | undefined;
}[]
authFields
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.toolkits: Toolkits
Retrieve toolkit metadata and authorize user connections
toolkits
.
Toolkits.getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, { requiredOnly }?: {
    requiredOnly?: boolean;
}): Promise<ToolkitAuthFieldsResponse>
Retrieves the fields required for creating an auth config for a toolkit.
@paramtoolkitSlug - The slug of the toolkit to retrieve the fields for@paramauthScheme - The auth scheme to retrieve the fields for@paramoptions.requiredOnly - Whether to only return the required fields@returnsThe fields required for creating an auth config
getAuthConfigCreationFields
('NOTION', 'OAUTH2', {
requiredOnly?: boolean | undefinedrequiredOnly: true, }); var console: Console
The `console` module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers. The module exports two specific components: * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. _**Warning**_: The global console object's methods are neither consistently synchronous like the browser APIs they resemble, nor are they consistently asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for more information. Example using the global `console`: ```js console.log('hello world'); // Prints: hello world, to stdout console.log('hello %s', 'world'); // Prints: hello world, to stdout console.error(new Error('Whoops, something bad happened')); // Prints error message and stack trace to stderr: // Error: Whoops, something bad happened // at [eval]:5:15 // at Script.runInThisContext (node:vm:132:18) // at Object.runInThisContext (node:vm:309:38) // at node:internal/process/execution:77:19 // at [eval]-wrapper:6:22 // at evalScript (node:internal/process/execution:76:60) // at node:internal/main/eval_string:23:3 const name = 'Will Robinson'; console.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to stderr ``` Example using the `Console` class: ```js const out = getStreamSomehow(); const err = getStreamSomehow(); const myConsole = new console.Console(out, err); myConsole.log('hello world'); // Prints: hello world, to out myConsole.log('hello %s', 'world'); // Prints: hello world, to out myConsole.error(new Error('Whoops, something bad happened')); // Prints: [Error: Whoops, something bad happened], to err const name = 'Will Robinson'; myConsole.warn(`Danger ${name}! Danger!`); // Prints: Danger Will Robinson! Danger!, to err ```
@see[source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
console
.Console.log(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)). ```js const count = 5; console.log('count: %d', count); // Prints: count: 5, to stdout console.log('count:', count); // Prints: count: 5, to stdout ``` See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
log
("Required auth config fields:",
const authFields: {
    name: string;
    description: string;
    type: string;
    displayName: string;
    required?: boolean | undefined;
    default?: string | null | undefined;
}[]
authFields
);

Then inspect the required fields and specify them in the credentials object.