Connected Accounts

Manage and monitor user connections to toolkits

Connected accounts are authenticated connections between your users and toolkits. After users authenticate (see Authenticating tools), you can manage these accounts throughout their lifecycle.

Composio automatically handles token refresh and credential management. This guide covers manual operations: listing, retrieving, refreshing, enabling, disabling, and deleting accounts.

List accounts

Retrieve all connected accounts with optional filters:

# List all accounts for a user
accounts = composio.connected_accounts.list(
    user_ids=[user_id]
)

# Filter by status
active_accounts = composio.connected_accounts.list(
    user_ids=[user_id],
    statuses=["ACTIVE"]
)
// List all accounts for a user
const 
const accounts: {
    items: {
        id: string;
        authConfig: TypeOf<ZodObject<{
            id: ZodString;
            isComposioManaged: ZodBoolean;
            isDisabled: ZodBoolean;
        }, "strip", ZodTypeAny, {
            id: string;
            isComposioManaged: boolean;
            isDisabled: boolean;
        }, {
            id: string;
            isComposioManaged: boolean;
            isDisabled: boolean;
        }>>;
        data?: Record<string, unknown>;
        params?: Record<string, unknown>;
        status: ConnectedAccountStatusEnum;
        statusReason: string | null;
        toolkit: {
            slug: string;
        };
        state?: TypeOf<ZodDiscriminatedUnion<"authScheme", [ZodObject<{
            authScheme: ZodLiteral<"OAUTH1">;
            val: ZodDiscriminatedUnion<"status", [ZodObject<{
                subdomain: ZodOptional<ZodString>;
                "your-domain": ZodOptional<ZodString>;
                region: ZodOptional<ZodString>;
                shop: ZodOptional<ZodString>;
                account_url: ZodOptional<ZodString>;
                COMPANYDOMAIN: ZodOptional<ZodString>;
                extension: ZodOptional<ZodString>;
                form_api_base_url: ZodOptional<ZodString>;
                instanceEndpoint: ZodOptional<ZodString>;
                api_url: ZodOptional<ZodString>;
                borneo_dashboard_url: ZodOptional<ZodString>;
                proxy_username: ZodOptional<ZodString>;
                proxy_password: ZodOptional<ZodString>;
                domain: ZodOptional<ZodString>;
                version: ZodOptional<ZodString>;
                dc: ZodOptional<ZodString>;
                site_name: ZodOptional<ZodString>;
                instanceName: ZodOptional<ZodString>;
                account_id: ZodOptional<ZodString>;
                your_server: ZodOptional<ZodString>;
                server_location: ZodOptional<ZodString>;
                base_url: ZodOptional<ZodString>;
                api_key: ZodOptional<ZodString>;
                generic_api_key: ZodOptional<ZodString>;
                bearer_token: ZodOptional<ZodString>;
                basic_encoded: ZodOptional<ZodString>;
                long_redirect_url: ZodOptional<ZodBoolean>;
                state_prefix: ZodOptional<ZodString>;
                registration_access_token: ZodOptional<ZodString>;
                registration_client_uri: ZodOptional<ZodString>;
                composio_link_redirect_url: ZodOptional<ZodString>;
            } & {
                status: ZodLiteral<"INITIALIZING">;
            }, "strip", ZodUnknown, objectOutputType<{
                subdomain: ZodOptional<ZodString>;
                "your-domain": ZodOptional<ZodString>;
                region: ZodOptional<ZodString>;
                shop: ZodOptional<ZodString>;
                account_url: ZodOptional<ZodString>;
                COMPANYDOMAIN: ZodOptional<ZodString>;
                extension: ZodOptional<ZodString>;
                form_api_base_url: ZodOptional<ZodString>;
                instanceEndpoint: ZodOptional<ZodString>;
                api_url: ZodOptional<ZodString>;
                borneo_dashboard_url: ZodOptional<ZodString>;
                proxy_username: ZodOptional<ZodString>;
                proxy_password: ZodOptional<ZodString>;
                domain: ZodOptional<ZodString>;
                version: ZodOptional<ZodString>;
                dc: ZodOptional<ZodString>;
                site_name: ZodOptional<ZodString>;
                instanceName: ZodOptional<ZodString>;
                account_id: ZodOptional<ZodString>;
                your_server: ZodOptional<ZodString>;
                server_location: ZodOptional<ZodString>;
                base_url: ZodOptional<ZodString>;
                api_key: ZodOptional<ZodString>;
                generic_api_key: ZodOptional<ZodString>;
                bearer_token: ZodOptional<ZodString>;
                basic_encoded: ZodOptional<ZodString>;
                long_redirect_url: ZodOptional<ZodBoolean>;
                state_prefix: ZodOptional<ZodString>;
                registration_access_token: ZodOptional<ZodString>;
                registration_client_uri: ZodOptional<ZodString>;
                composio_link_redirect_url: ZodOptional<ZodString>;
            } & {
                status: ZodLiteral<"INITIALIZING">;
            }, ZodUnknown, "strip">, objectInputType<{
                subdomain: ZodOptional<ZodString>;
                "your-domain": ZodOptional<ZodString>;
                region: ZodOptional<ZodString>;
                shop: ZodOptional<ZodString>;
                account_url: ZodOptional<ZodString>;
                COMPANYDOMAIN: ZodOptional<ZodString>;
                extension: ZodOptional<ZodString>;
                form_api_base_url: ZodOptional<ZodString>;
                instanceEndpoint: ZodOptional<ZodString>;
                api_url: ZodOptional<ZodString>;
                borneo_dashboard_url ...
accounts
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.list(query?: ConnectedAccountListParams): Promise<ConnectedAccountListResponse>
Lists all connected accounts based on provided filter criteria. This method retrieves connected accounts from the Composio API with optional filtering.
@paramquery - Optional query parameters for filtering connected accounts@returnsA paginated list of connected accounts@throws{ValidationError} If the query fails validation against the expected schema@example```typescript // List all connected accounts const allAccounts = await composio.connectedAccounts.list(); // List accounts for a specific user const userAccounts = await composio.connectedAccounts.list({ userIds: ['user123'] }); // List accounts for a specific toolkit const githubAccounts = await composio.connectedAccounts.list({ toolkitSlugs: ['github'] }); ```
list
({
userIds?: string[] | null | undefineduserIds: [const userId: "user_123"userId] }); // Filter by status const
const activeAccounts: {
    items: {
        id: string;
        authConfig: TypeOf<ZodObject<{
            id: ZodString;
            isComposioManaged: ZodBoolean;
            isDisabled: ZodBoolean;
        }, "strip", ZodTypeAny, {
            id: string;
            isComposioManaged: boolean;
            isDisabled: boolean;
        }, {
            id: string;
            isComposioManaged: boolean;
            isDisabled: boolean;
        }>>;
        data?: Record<string, unknown>;
        params?: Record<string, unknown>;
        status: ConnectedAccountStatusEnum;
        statusReason: string | null;
        toolkit: {
            slug: string;
        };
        state?: TypeOf<ZodDiscriminatedUnion<"authScheme", [ZodObject<{
            authScheme: ZodLiteral<"OAUTH1">;
            val: ZodDiscriminatedUnion<"status", [ZodObject<{
                subdomain: ZodOptional<ZodString>;
                "your-domain": ZodOptional<ZodString>;
                region: ZodOptional<ZodString>;
                shop: ZodOptional<ZodString>;
                account_url: ZodOptional<ZodString>;
                COMPANYDOMAIN: ZodOptional<ZodString>;
                extension: ZodOptional<ZodString>;
                form_api_base_url: ZodOptional<ZodString>;
                instanceEndpoint: ZodOptional<ZodString>;
                api_url: ZodOptional<ZodString>;
                borneo_dashboard_url: ZodOptional<ZodString>;
                proxy_username: ZodOptional<ZodString>;
                proxy_password: ZodOptional<ZodString>;
                domain: ZodOptional<ZodString>;
                version: ZodOptional<ZodString>;
                dc: ZodOptional<ZodString>;
                site_name: ZodOptional<ZodString>;
                instanceName: ZodOptional<ZodString>;
                account_id: ZodOptional<ZodString>;
                your_server: ZodOptional<ZodString>;
                server_location: ZodOptional<ZodString>;
                base_url: ZodOptional<ZodString>;
                api_key: ZodOptional<ZodString>;
                generic_api_key: ZodOptional<ZodString>;
                bearer_token: ZodOptional<ZodString>;
                basic_encoded: ZodOptional<ZodString>;
                long_redirect_url: ZodOptional<ZodBoolean>;
                state_prefix: ZodOptional<ZodString>;
                registration_access_token: ZodOptional<ZodString>;
                registration_client_uri: ZodOptional<ZodString>;
                composio_link_redirect_url: ZodOptional<ZodString>;
            } & {
                status: ZodLiteral<"INITIALIZING">;
            }, "strip", ZodUnknown, objectOutputType<{
                subdomain: ZodOptional<ZodString>;
                "your-domain": ZodOptional<ZodString>;
                region: ZodOptional<ZodString>;
                shop: ZodOptional<ZodString>;
                account_url: ZodOptional<ZodString>;
                COMPANYDOMAIN: ZodOptional<ZodString>;
                extension: ZodOptional<ZodString>;
                form_api_base_url: ZodOptional<ZodString>;
                instanceEndpoint: ZodOptional<ZodString>;
                api_url: ZodOptional<ZodString>;
                borneo_dashboard_url: ZodOptional<ZodString>;
                proxy_username: ZodOptional<ZodString>;
                proxy_password: ZodOptional<ZodString>;
                domain: ZodOptional<ZodString>;
                version: ZodOptional<ZodString>;
                dc: ZodOptional<ZodString>;
                site_name: ZodOptional<ZodString>;
                instanceName: ZodOptional<ZodString>;
                account_id: ZodOptional<ZodString>;
                your_server: ZodOptional<ZodString>;
                server_location: ZodOptional<ZodString>;
                base_url: ZodOptional<ZodString>;
                api_key: ZodOptional<ZodString>;
                generic_api_key: ZodOptional<ZodString>;
                bearer_token: ZodOptional<ZodString>;
                basic_encoded: ZodOptional<ZodString>;
                long_redirect_url: ZodOptional<ZodBoolean>;
                state_prefix: ZodOptional<ZodString>;
                registration_access_token: ZodOptional<ZodString>;
                registration_client_uri: ZodOptional<ZodString>;
                composio_link_redirect_url: ZodOptional<ZodString>;
            } & {
                status: ZodLiteral<"INITIALIZING">;
            }, ZodUnknown, "strip">, objectInputType<{
                subdomain: ZodOptional<ZodString>;
                "your-domain": ZodOptional<ZodString>;
                region: ZodOptional<ZodString>;
                shop: ZodOptional<ZodString>;
                account_url: ZodOptional<ZodString>;
                COMPANYDOMAIN: ZodOptional<ZodString>;
                extension: ZodOptional<ZodString>;
                form_api_base_url: ZodOptional<ZodString>;
                instanceEndpoint: ZodOptional<ZodString>;
                api_url: ZodOptional<ZodString>;
                borneo_dashboard_url ...
activeAccounts
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.list(query?: ConnectedAccountListParams): Promise<ConnectedAccountListResponse>
Lists all connected accounts based on provided filter criteria. This method retrieves connected accounts from the Composio API with optional filtering.
@paramquery - Optional query parameters for filtering connected accounts@returnsA paginated list of connected accounts@throws{ValidationError} If the query fails validation against the expected schema@example```typescript // List all connected accounts const allAccounts = await composio.connectedAccounts.list(); // List accounts for a specific user const userAccounts = await composio.connectedAccounts.list({ userIds: ['user123'] }); // List accounts for a specific toolkit const githubAccounts = await composio.connectedAccounts.list({ toolkitSlugs: ['github'] }); ```
list
({
userIds?: string[] | null | undefineduserIds: [const userId: "user_123"userId], statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE")[] | null | undefinedstatuses: ['ACTIVE'] });

Get account details

Retrieve a connected account by ID:

account = composio.connected_accounts.get(connected_account_id)

print(f"Status: {account.status}")
print(f"Toolkit: {account.toolkit.slug}")
const 
const account: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
account
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.get(nanoid: string): Promise<ConnectedAccountRetrieveResponse>
Retrieves a specific connected account by its ID. This method fetches detailed information about a single connected account and transforms the response to the SDK's standardized format.
@paramnanoid - The unique identifier of the connected account@returnsThe connected account details@throws{Error} If the connected account cannot be found or an API error occurs@example```typescript // Get a connected account by ID const account = await composio.connectedAccounts.get('conn_abc123'); console.log(account.status); // e.g., 'ACTIVE' console.log(account.toolkit.slug); // e.g., 'github' ```
get
(const connectedAccountId: "ca_123"connectedAccountId);
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
('Status:',
const account: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
account
.status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE"status);
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
('Toolkit:',
const account: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
account
.
toolkit: {
    slug: string;
}
toolkit
.slug: stringslug);

Get account credentials

Get account credentials for use with your own tools:

# Get the connected account's authentication state
if account.state:
    # The state contains the auth scheme and credentials
    auth_scheme = account.state.auth_scheme
    credentials = account.state.val

    print(f"Auth scheme: {auth_scheme}")
    print(f"Credentials: {credentials}")
// Get the connected account's authentication state
if (
const account: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
account
.
state?: {
    authScheme: "OAUTH1";
    val: objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"INITIALIZING">;
    }, ZodUnknown, "strip"> | objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"INITIATED">;
        authUri: ZodString;
        oauth_token: ZodString;
        oauth_token_secret: ZodString;
        redirectUrl: ZodString;
        callbackUrl: ZodOptional<ZodString>;
    }, ZodUnknown, "strip"> | objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"ACTIVE">;
        oauth_token: ZodString;
        oauth_token_secret: ZodString;
        consumer_key: ZodOptional<ZodString>;
        oauth_verifier: ZodOptional<ZodString>;
        redirectUrl: ZodOptional<ZodString ...
state
) {
// The state contains the auth scheme and credentials const const authScheme: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "CALCOM_AUTH" | "BILLCOM_AUTH" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH"authScheme =
const account: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
account
.
state?: {
    authScheme: "OAUTH1";
    val: objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"INITIALIZING">;
    }, ZodUnknown, "strip"> | objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"INITIATED">;
        authUri: ZodString;
        oauth_token: ZodString;
        oauth_token_secret: ZodString;
        redirectUrl: ZodString;
        callbackUrl: ZodOptional<ZodString>;
    }, ZodUnknown, "strip"> | objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"ACTIVE">;
        oauth_token: ZodString;
        oauth_token_secret: ZodString;
        consumer_key: ZodOptional<ZodString>;
        oauth_verifier: ZodOptional<ZodString>;
        redirectUrl: ZodOptional<ZodString ...
state
.authScheme: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "CALCOM_AUTH" | "BILLCOM_AUTH" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH"authScheme;
const
const credentials: objectOutputType<{
    subdomain: ZodOptional<ZodString>;
    "your-domain": ZodOptional<ZodString>;
    region: ZodOptional<ZodString>;
    shop: ZodOptional<ZodString>;
    account_url: ZodOptional<ZodString>;
    COMPANYDOMAIN: ZodOptional<ZodString>;
    ... 24 more ...;
    composio_link_redirect_url: ZodOptional<ZodString>;
} & {
    ...;
}, ZodUnknown, "strip"> | ... 74 more ... | objectOutputType<...>
credentials
=
const account: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
account
.
state?: {
    authScheme: "OAUTH1";
    val: objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"INITIALIZING">;
    }, ZodUnknown, "strip"> | objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"INITIATED">;
        authUri: ZodString;
        oauth_token: ZodString;
        oauth_token_secret: ZodString;
        redirectUrl: ZodString;
        callbackUrl: ZodOptional<ZodString>;
    }, ZodUnknown, "strip"> | objectOutputType<{
        subdomain: ZodOptional<ZodString>;
        "your-domain": ZodOptional<ZodString>;
        region: ZodOptional<ZodString>;
        shop: ZodOptional<ZodString>;
        account_url: ZodOptional<ZodString>;
        COMPANYDOMAIN: ZodOptional<ZodString>;
        extension: ZodOptional<ZodString>;
        form_api_base_url: ZodOptional<ZodString>;
        instanceEndpoint: ZodOptional<ZodString>;
        api_url: ZodOptional<ZodString>;
        borneo_dashboard_url: ZodOptional<ZodString>;
        proxy_username: ZodOptional<ZodString>;
        proxy_password: ZodOptional<ZodString>;
        domain: ZodOptional<ZodString>;
        version: ZodOptional<ZodString>;
        dc: ZodOptional<ZodString>;
        site_name: ZodOptional<ZodString>;
        instanceName: ZodOptional<ZodString>;
        account_id: ZodOptional<ZodString>;
        your_server: ZodOptional<ZodString>;
        server_location: ZodOptional<ZodString>;
        base_url: ZodOptional<ZodString>;
        api_key: ZodOptional<ZodString>;
        generic_api_key: ZodOptional<ZodString>;
        bearer_token: ZodOptional<ZodString>;
        basic_encoded: ZodOptional<ZodString>;
        long_redirect_url: ZodOptional<ZodBoolean>;
        state_prefix: ZodOptional<ZodString>;
        registration_access_token: ZodOptional<ZodString>;
        registration_client_uri: ZodOptional<ZodString>;
        composio_link_redirect_url: ZodOptional<ZodString>;
    } & {
        status: ZodLiteral<"ACTIVE">;
        oauth_token: ZodString;
        oauth_token_secret: ZodString;
        consumer_key: ZodOptional<ZodString>;
        oauth_verifier: ZodOptional<ZodString>;
        redirectUrl: ZodOptional<ZodString ...
state
.
val: objectOutputType<{
    subdomain: ZodOptional<ZodString>;
    "your-domain": ZodOptional<ZodString>;
    region: ZodOptional<ZodString>;
    shop: ZodOptional<ZodString>;
    account_url: ZodOptional<ZodString>;
    COMPANYDOMAIN: ZodOptional<ZodString>;
    ... 24 more ...;
    composio_link_redirect_url: ZodOptional<ZodString>;
} & {
    ...;
}, ZodUnknown, "strip"> | ... 74 more ... | objectOutputType<...>
val
;
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
('Auth scheme:', const authScheme: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "CALCOM_AUTH" | "BILLCOM_AUTH" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH"authScheme);
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
('Credentials:',
const credentials: objectOutputType<{
    subdomain: ZodOptional<ZodString>;
    "your-domain": ZodOptional<ZodString>;
    region: ZodOptional<ZodString>;
    shop: ZodOptional<ZodString>;
    account_url: ZodOptional<ZodString>;
    COMPANYDOMAIN: ZodOptional<ZodString>;
    ... 24 more ...;
    composio_link_redirect_url: ZodOptional<ZodString>;
} & {
    ...;
}, ZodUnknown, "strip"> | ... 74 more ... | objectOutputType<...>
credentials
);
}

If credentials return as REDACTED instead of actual values, the Mask Connected Account Secrets setting is enabled on your account. This setting redacts all sensitive credential data (tokens, secrets, API keys) for security purposes.

To view actual credentials, navigate to Settings → Project Settings → Project Configuration and disable "Mask Connected Account Secrets".

Refresh credentials

Manually refresh credentials for a connected account:

try:
    refreshed = composio.connected_accounts.refresh(connected_account_id)
    print(f"Redirect URL: {refreshed.redirect_url}")

    # Wait for the connection to be established
    composio.connected_accounts.wait_for_connection(refreshed.id)
except Exception as e:
    print(f"Failed to refresh tokens: {e}")
try {
  const const refreshed: ConnectedAccountRefreshResponserefreshed = await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.refresh(nanoid: string): Promise<ConnectedAccountRefreshResponse>
Refreshes a connected account's authentication credentials. This method attempts to refresh OAuth tokens or other credentials associated with the connected account. This is useful when a token has expired or is about to expire.
@paramnanoid - The unique identifier of the connected account to refresh@returnsThe response containing the refreshed account details@throws{Error} If the account doesn't exist or credentials cannot be refreshed@example```typescript // Refresh a connected account's credentials const refreshedAccount = await composio.connectedAccounts.refresh('conn_abc123'); ```
refresh
(const connectedAccountId: "ca_123"connectedAccountId);
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
('Redirect URL:', const refreshed: ConnectedAccountRefreshResponserefreshed.ConnectedAccountRefreshResponse.redirect_url: string | null
The URL to which the user should be redirected to complete the authentication process (null for auth schemes that do not require redirection)
redirect_url
);
// Wait for the connection to be established await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.waitForConnection(connectedAccountId: string, timeout?: number): Promise<ConnectedAccountRetrieveResponse>
Waits for a connection request to complete and become active. This method continuously polls the Composio API to check the status of a connection until it either becomes active, enters a terminal error state, or times out.
@paramconnectedAccountId - The ID of the connected account to wait for@paramtimeout - Maximum time to wait in milliseconds (default: 60 seconds)@returnsThe finalized connected account data@throws{ComposioConnectedAccountNotFoundError} If the connected account cannot be found@throws{ConnectionRequestFailedError} If the connection enters a failed, expired, or deleted state@throws{ConnectionRequestTimeoutError} If the connection does not complete within the timeout period@example```typescript // Wait for a connection to complete with default timeout const connectedAccount = await composio.connectedAccounts.waitForConnection('conn_123abc'); // Wait with a custom timeout of 2 minutes const connectedAccount = await composio.connectedAccounts.waitForConnection('conn_123abc', 120000); ```
waitForConnection
(const refreshed: ConnectedAccountRefreshResponserefreshed.ConnectedAccountRefreshResponse.id: string
The unique identifier of the connected account
id
);
} catch (var error: unknownerror) { 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.error(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stderr` 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 code = 5; console.error('error #%d', code); // Prints: error #5, to stderr console.error('error', code); // Prints: error 5, to stderr ``` If formatting elements (e.g. `%d`) are not found in the first string then [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) is called on each argument and the resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
error
('Failed to refresh tokens:', var error: unknownerror);
}

Enable and disable accounts

Change account status without deleting. Set to INACTIVE to pause access, or ACTIVE to restore. Useful for:

  • Pausing access during subscription lapses
  • Temporary disconnection
# Disable an account
disabled = composio.connected_accounts.disable(connected_account_id)
print(f"Account disabled status: {disabled.success}")

# Re-enable when needed
enabled = composio.connected_accounts.enable(connected_account_id)
print(f"Account enabled status: {enabled.success}")
// Disable an account
const const disabled: ConnectedAccountUpdateStatusResponsedisabled = await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>
Disable a connected account
@paramnanoid - Unique identifier of the connected account@returnsUpdated connected account details@example```typescript // Disable a connected account const disabledAccount = await composio.connectedAccounts.disable('conn_abc123'); console.log(disabledAccount.isDisabled); // true // You can also use updateStatus with a reason // const disabledAccount = await composio.connectedAccounts.updateStatus('conn_abc123', { // enabled: false, // reason: 'No longer needed' // }); ```
disable
(const connectedAccountId: "ca_123"connectedAccountId);
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
('Account disabled status:', const disabled: ConnectedAccountUpdateStatusResponsedisabled.ConnectedAccountUpdateStatusResponse.success: boolean
Indicates whether the connected account status was successfully updated
success
);
// Re-enable when needed const const enabled: ConnectedAccountUpdateStatusResponseenabled = await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.enable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>
Enable a connected account
@paramnanoid - Unique identifier of the connected account@returnsUpdated connected account details@example```typescript // Enable a previously disabled connected account const enabledAccount = await composio.connectedAccounts.enable('conn_abc123'); console.log(enabledAccount.isDisabled); // false ```
enable
(const connectedAccountId: "ca_123"connectedAccountId);
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
('Account enabled status:', const enabled: ConnectedAccountUpdateStatusResponseenabled.ConnectedAccountUpdateStatusResponse.success: boolean
Indicates whether the connected account status was successfully updated
success
);

INACTIVE accounts cannot execute tools. Tool execution will fail until the status is changed.

Delete accounts

Permanently remove a connected account and revoke all credentials:

# Delete a connected account
composio.connected_accounts.delete(connected_account_id)
print("Account deleted successfully")
// Delete a connected account
await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.delete(nanoid: string): Promise<ConnectedAccountDeleteResponse>
Deletes a connected account. This method permanently removes a connected account from the Composio platform. This action cannot be undone and will revoke any access tokens associated with the account.
@paramnanoid - The unique identifier of the connected account to delete@returnsThe deletion response@throws{Error} If the account doesn't exist or cannot be deleted@example```typescript // Delete a connected account await composio.connectedAccounts.delete('conn_abc123'); ```
delete
(const connectedAccountId: "ca_123"connectedAccountId);
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
('Account deleted successfully');

Deletion is permanent. Users must re-authenticate to reconnect.

Multiple accounts

Users can connect multiple accounts for the same toolkit (e.g., personal and work Gmail).

Use link() for creating accounts, as it provides hosted authentication and allows multiple accounts by default. See Connect Link authentication.

# First account
try:
    first_account = composio.connected_accounts.initiate(
        user_id=user_id,
        auth_config_id=auth_config_id
    )
    print(f"First account redirect URL: {first_account.redirect_url}")
    connected_first_account = first_account.wait_for_connection()
    print(f"First account status: {connected_first_account.status}")
except Exception as e:
    print(f"Error initiating first account: {e}")

# Second account - must explicitly allow multiple
try:
    second_account = composio.connected_accounts.initiate(
        user_id=user_id,
        auth_config_id=auth_config_id,
        allow_multiple=True  # Required for additional accounts
    )
    print(f"Second account redirect URL: {second_account.redirect_url}")
    connected_second_account = second_account.wait_for_connection()
    print(f"Second account status: {connected_second_account.status}")
except Exception as e:
    print(f"Error initiating second account: {e}")
// First account
try {
  const const firstAccount: ConnectionRequestfirstAccount = await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.initiate(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>
Compound function to create a new connected account. This function creates a new connected account and returns a connection request. Users can then wait for the connection to be established using the `waitForConnection` method.
@paramuserId - User ID of the connected account@paramauthConfigId - Auth config ID of the connected account@paramoptions - Options for creating a new connected account@returnsConnection request object@example```typescript // For OAuth2 authentication const connectionRequest = await composio.connectedAccounts.initiate( 'user_123', 'auth_config_123', { callbackUrl: 'https://your-app.com/callback', config: AuthScheme.OAuth2({ access_token: 'your_access_token', token_type: 'Bearer' }) } ); // For API Key authentication const connectionRequest = await composio.connectedAccounts.initiate( 'user_123', 'auth_config_123', { config: AuthScheme.ApiKey({ api_key: 'your_api_key' }) } ); // For Basic authentication const connectionRequest = await composio.connectedAccounts.initiate( 'user_123', 'auth_config_123', { config: AuthScheme.Basic({ username: 'your_username', password: 'your_password' }) } ); ```@linkhttps://docs.composio.dev/reference/connected-accounts/create-connected-account
initiate
(
const userId: "user_123"userId, const authConfigId: "ac_123"authConfigId ); 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
('First account redirect URL:', const firstAccount: ConnectionRequestfirstAccount.ConnectionRequestState.redirectUrl?: string | null | undefinedredirectUrl);
const
const connectedFirstAccount: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
connectedFirstAccount
= await const firstAccount: ConnectionRequestfirstAccount.ConnectionRequest.waitForConnection: (timeout?: number) => Promise<ConnectedAccountRetrieveResponse>waitForConnection();
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
('First account status:',
const connectedFirstAccount: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
connectedFirstAccount
.status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE"status);
} catch (var error: unknownerror) { 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.error(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stderr` 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 code = 5; console.error('error #%d', code); // Prints: error #5, to stderr console.error('error', code); // Prints: error 5, to stderr ``` If formatting elements (e.g. `%d`) are not found in the first string then [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) is called on each argument and the resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
error
('Error initiating first account:', var error: unknownerror);
} // Second account - must explicitly allow multiple try { const const secondAccount: ConnectionRequestsecondAccount = await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.connectedAccounts: ConnectedAccounts
Manage authenticated connections
connectedAccounts
.ConnectedAccounts.initiate(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>
Compound function to create a new connected account. This function creates a new connected account and returns a connection request. Users can then wait for the connection to be established using the `waitForConnection` method.
@paramuserId - User ID of the connected account@paramauthConfigId - Auth config ID of the connected account@paramoptions - Options for creating a new connected account@returnsConnection request object@example```typescript // For OAuth2 authentication const connectionRequest = await composio.connectedAccounts.initiate( 'user_123', 'auth_config_123', { callbackUrl: 'https://your-app.com/callback', config: AuthScheme.OAuth2({ access_token: 'your_access_token', token_type: 'Bearer' }) } ); // For API Key authentication const connectionRequest = await composio.connectedAccounts.initiate( 'user_123', 'auth_config_123', { config: AuthScheme.ApiKey({ api_key: 'your_api_key' }) } ); // For Basic authentication const connectionRequest = await composio.connectedAccounts.initiate( 'user_123', 'auth_config_123', { config: AuthScheme.Basic({ username: 'your_username', password: 'your_password' }) } ); ```@linkhttps://docs.composio.dev/reference/connected-accounts/create-connected-account
initiate
(
const userId: "user_123"userId, const authConfigId: "ac_123"authConfigId, { allowMultiple?: boolean | undefinedallowMultiple: true // Required for additional accounts } ); 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
('Second account redirect URL:', const secondAccount: ConnectionRequestsecondAccount.ConnectionRequestState.redirectUrl?: string | null | undefinedredirectUrl);
const
const connectedSecondAccount: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
connectedSecondAccount
= await const secondAccount: ConnectionRequestsecondAccount.ConnectionRequest.waitForConnection: (timeout?: number) => Promise<ConnectedAccountRetrieveResponse>waitForConnection();
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
('Second account status:',
const connectedSecondAccount: {
    id: string;
    authConfig: TypeOf<ZodObject<{
        id: ZodString;
        isComposioManaged: ZodBoolean;
        isDisabled: ZodBoolean;
    }, "strip", ZodTypeAny, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }, {
        id: string;
        isComposioManaged: boolean;
        isDisabled: boolean;
    }>>;
    data?: Record<string, unknown>;
    params?: Record<string, unknown>;
    status: ConnectedAccountStatusEnum;
    ... 6 more ...;
    updatedAt: string;
}
connectedSecondAccount
.status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE"status);
} catch (var error: unknownerror) { 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.error(message?: any, ...optionalParams: any[]): void (+1 overload)
Prints to `stderr` 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 code = 5; console.error('error #%d', code); // Prints: error #5, to stderr console.error('error', code); // Prints: error 5, to stderr ``` If formatting elements (e.g. `%d`) are not found in the first string then [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) is called on each argument and the resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
@sincev0.1.100
error
('Error initiating second account:', var error: unknownerror);
}

Execute with a specific account

When you have multiple accounts, specify which one to use with connected_account_id:

# Execute tool with a specific connected account
result = composio.tools.execute(
    "GMAIL_GET_PROFILE",
    user_id=user_id,
    connected_account_id=connected_account_id,  # Specify which account to use
    version="20251111_00",
    arguments={}
)
print(f"Tool executed: {result}")
// Execute tool with a specific connected account
const 
const result: {
    error: string | null;
    data: Record<string, unknown>;
    successful: boolean;
    logId?: string | undefined;
    sessionInfo?: unknown;
}
result
= await const composio: Composio<OpenAIProvider>composio.Composio<OpenAIProvider>.tools: Tools<unknown, unknown, OpenAIProvider>
List, retrieve, and execute tools
tools
.Tools<unknown, unknown, OpenAIProvider>.execute(slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers): Promise<ToolExecuteResponse>
Executes a given tool with the provided parameters. This method calls the Composio API or a custom tool handler to execute the tool and returns the response. It automatically determines whether to use a custom tool or a Composio API tool based on the slug. **Version Control:** By default, manual tool execution requires a specific toolkit version. If the version resolves to "latest", the execution will throw a `ComposioToolVersionRequiredError` unless `dangerouslySkipVersionCheck` is set to `true`. This helps prevent unexpected behavior when new toolkit versions are released.
@paramslug - The slug/ID of the tool to be executed@parambody - The parameters to be passed to the tool@parambody.version - The specific version of the tool to execute (e.g., "20250909_00")@parambody.dangerouslySkipVersionCheck - Skip version validation for "latest" version (use with caution)@parambody.userId - The user ID to execute the tool for@parambody.connectedAccountId - The connected account ID to use for authenticated tools@parambody.arguments - The arguments to pass to the tool@parammodifiers - Optional modifiers to transform the request or response@returns- The response from the tool execution@throws{ComposioCustomToolsNotInitializedError} If the CustomTools instance is not initialized@throws{ComposioConnectedAccountNotFoundError} If the connected account is not found@throws{ComposioToolNotFoundError} If the tool with the given slug is not found@throws{ComposioToolVersionRequiredError} If version resolves to "latest" and dangerouslySkipVersionCheck is not true@throws{ComposioToolExecutionError} If there is an error during tool execution@exampleExecute with a specific version (recommended for production) ```typescript const result = await composio.tools.execute('GITHUB_GET_REPOS', { userId: 'default', version: '20250909_00', arguments: { owner: 'composio' } }); ```@exampleExecute with dangerouslySkipVersionCheck (not recommended for production) ```typescript const result = await composio.tools.execute('HACKERNEWS_GET_USER', { userId: 'default', arguments: { userId: 'pg' }, dangerouslySkipVersionCheck: true // Allows execution with "latest" version }); ```@exampleExecute with SDK-level toolkit versions configuration ```typescript // If toolkitVersions are set during Composio initialization, no need to pass version const composio = new Composio({ toolkitVersions: { github: '20250909_00' } }); const result = await composio.tools.execute('GITHUB_GET_REPOS', { userId: 'default', arguments: { owner: 'composio' } }); ```@exampleExecute with modifiers ```typescript const result = await composio.tools.execute('GITHUB_GET_ISSUES', { userId: 'default', version: '20250909_00', arguments: { owner: 'composio', repo: 'sdk' } }, { beforeExecute: ({ toolSlug, toolkitSlug, params }) => { console.log(`Executing ${toolSlug} from ${toolkitSlug}`); return params; }, afterExecute: ({ toolSlug, toolkitSlug, result }) => { console.log(`Completed ${toolSlug}`); return result; } }); ```
execute
('GMAIL_GET_PROFILE', {
userId?: string | undefineduserId: const userId: "user_123"userId, connectedAccountId?: string | undefinedconnectedAccountId: const connectedAccountId: "ca_123"connectedAccountId, // Specify which account to use version?: string | undefinedversion: '20251111_00', arguments?: Record<string, unknown> | undefinedarguments: {} }); 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
('Tool executed:',
const result: {
    error: string | null;
    data: Record<string, unknown>;
    successful: boolean;
    logId?: string | undefined;
    sessionInfo?: unknown;
}
result
);