AuthConfigs

@composio/core


@composio/core / AuthConfigs / AuthConfigs

Class: AuthConfigs

Defined in: ts/packages/core/src/models/AuthConfigs.ts:37

AuthConfigs class

This class is used to manage authentication configurations in the Composio SDK. Auth configs are used to configure authentication providers and settings.

Constructors

Constructor

new AuthConfigs(client): AuthConfigs

Defined in: ts/packages/core/src/models/AuthConfigs.ts:40

Parameters

client

Composio

Returns

AuthConfigs

Methods

create()

create(toolkit, options): Promise<{ }>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:161

Create a new auth config

Parameters

toolkit

string

Unique identifier of the toolkit

options

Options for creating a new auth config

{ } | { }

Returns

Promise<{ }>

Created auth config

Example

1const authConfig = await authConfigs.create('my-toolkit', {
2 type: AuthConfigTypes.CUSTOM,
3 name: 'My Custom Auth Config',
4 authScheme: AuthSchemeTypes.API_KEY,
5 credentials: {
6 apiKey: '1234567890',
7 },
8});

https://docs.composio.dev/reference/auth-configs/create-auth-config


delete()

delete(nanoid): Promise<unknown>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:299

Deletes an authentication configuration.

This method permanently removes an auth config from the Composio platform. This action cannot be undone and will prevent any connected accounts that use this auth config from functioning.

Parameters

nanoid

string

The unique identifier of the auth config to delete

Returns

Promise<unknown>

The deletion response

Throws

If the auth config doesn’t exist or cannot be deleted

Example

1// Delete an auth config
2await composio.authConfigs.delete('auth_abc123');

disable()

disable(nanoid): Promise<unknown>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:369

Disables an authentication configuration.

This is a convenience method that calls updateStatus with ‘DISABLED’. When disabled, the auth config cannot be used to create new connected accounts or authenticate with third-party services, but existing connections may continue to work.

Parameters

nanoid

string

The unique identifier of the auth config to disable

Returns

Promise<unknown>

The updated auth config details

Throws

If the auth config cannot be found or disabled

Example

1// Disable an auth config
2await composio.authConfigs.disable('auth_abc123');

enable()

enable(nanoid): Promise<unknown>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:348

Enables an authentication configuration.

This is a convenience method that calls updateStatus with ‘ENABLED’. When enabled, the auth config can be used to create new connected accounts and authenticate with third-party services.

Parameters

nanoid

string

The unique identifier of the auth config to enable

Returns

Promise<unknown>

The updated auth config details

Throws

If the auth config cannot be found or enabled

Example

1// Enable an auth config
2await composio.authConfigs.enable('auth_abc123');

get()

get(nanoid): Promise<{ }>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:224

Retrieves a specific authentication configuration by its ID.

This method fetches detailed information about a single auth config and transforms the response to the SDK’s standardized format.

Parameters

nanoid

string

The unique identifier of the auth config to retrieve

Returns

Promise<{ }>

The auth config details

Throws

If the auth config cannot be found or an API error occurs

Throws

If the response fails validation

Example

1// Get an auth config by ID
2const authConfig = await composio.authConfigs.get('auth_abc123');
3console.log(authConfig.name); // e.g., 'GitHub Auth'
4console.log(authConfig.toolkit.slug); // e.g., 'github'

getClient()

protected getClient(): Composio

Defined in: ts/packages/core/src/models/AuthConfigs.ts:50

Protected getter for the client instance. This is primarily used for testing purposes.

Returns

Composio


list()

list(query?): Promise<{ }>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:122

Lists authentication configurations based on provided filter criteria.

This method retrieves auth configs from the Composio API, transforms them to the SDK format, and supports filtering by various parameters.

Parameters

query?

Optional query parameters for filtering auth configs

Returns

Promise<{ }>

A paginated list of auth configurations

Throws

If the query parameters or response fail validation

Example

1// List all auth configs
2const allConfigs = await composio.authConfigs.list();
3
4// List auth configs for a specific toolkit
5const githubConfigs = await composio.authConfigs.list({
6 toolkit: 'github'
7});
8
9// List Composio-managed auth configs
10const managedConfigs = await composio.authConfigs.list({
11 isComposioManaged: true
12});

update()

update(nanoid, data): Promise<unknown>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:259

Updates an existing authentication configuration.

This method allows you to modify properties of an auth config such as credentials, scopes, or tool restrictions. The update type (custom or default) determines which fields can be updated.

Parameters

nanoid

string

The unique identifier of the auth config to update

data

The data to update, which can be either custom or default type

{ } | { }

Returns

Promise<unknown>

The updated auth config

Throws

If the update parameters are invalid

Throws

If the auth config cannot be found or updated

Example

1// Update a custom auth config with new credentials
2const updatedConfig = await composio.authConfigs.update('auth_abc123', {
3 type: 'custom',
4 credentials: {
5 apiKey: 'new-api-key-value'
6 }
7});
8
9// Update a default auth config with new scopes
10const updatedConfig = await composio.authConfigs.update('auth_abc123', {
11 type: 'default',
12 scopes: ['read:user', 'repo']
13});

updateStatus()

updateStatus(status, nanoid): Promise<unknown>

Defined in: ts/packages/core/src/models/AuthConfigs.ts:324

Updates the status of an authentication configuration.

This method allows you to enable or disable an auth config. When disabled, the auth config cannot be used to create new connected accounts or authenticate with third-party services.

Parameters

status

The status to set (‘ENABLED’ or ‘DISABLED’)

"ENABLED" | "DISABLED"

nanoid

string

The unique identifier of the auth config

Returns

Promise<unknown>

The updated auth config details

Throws

If the auth config cannot be found or the status cannot be updated

Example

1// Disable an auth config
2await composio.authConfigs.updateStatus('DISABLED', 'auth_abc123');
3
4// Enable an auth config
5await composio.authConfigs.updateStatus('ENABLED', 'auth_abc123');