Toolkits
Usage
Access this class through the devcaster.toolkits property:
const devcaster = new Devcaster({ apiKey: 'your-api-key' });
const result = await devcaster.toolkits.list();Methods
authorize()
Authorizes a user to use a toolkit. This method will create an auth config if one doesn't exist and initiate a connection request.
async authorize(userId: string, toolkitSlug: string, authConfigId?: string): Promise<ConnectionRequest>Parameters
| Name | Type | Description |
|---|---|---|
userId | string | The user id of the user to authorize |
toolkitSlug | string | The slug of the toolkit to authorize |
authConfigId? | string |
Returns
Promise<ConnectionRequest> — The connection request object
Example
const connectionRequest = await devcaster.toolkits.authorize(userId, 'github');get()
Retrieves a specific toolkit by its slug identifier.
Overload 1
async get(slug: string): Promise<...>Parameters
| Name | Type | Description |
|---|---|---|
slug | string | The unique slug identifier of the toolkit to retrieve |
Returns
Promise<...> — The toolkit object with detailed information
Overload 2
async get(query?: object): Promise<...>Parameters
| Name | Type | Description |
|---|---|---|
query? | object | The query parameters to filter toolkits |
Returns
Promise<...> — A paginated list of toolkits matching the query criteria
Example
// Get a specific toolkit
const githubToolkit = await devcaster.toolkits.get('github');
console.log(githubToolkit.name); // GitHub
console.log(githubToolkit.authConfigDetails); // Authentication configuration detailsgetAuthConfigCreationFields()
Retrieves the fields required for creating an auth config for a toolkit.
async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<...>Parameters
| Name | Type | Description |
|---|---|---|
toolkitSlug | string | The slug of the toolkit to retrieve the fields for |
authScheme | AuthSchemeType | The auth scheme to retrieve the fields for |
options | object |
Returns
Promise<...> — The fields required for creating an auth config
getConnectedAccountInitiationFields()
Retrieves the fields required for initiating a connected account for a toolkit.
async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<...>Parameters
| Name | Type | Description |
|---|---|---|
toolkitSlug | string | The slug of the toolkit to retrieve the fields for |
authScheme | AuthSchemeType | The auth scheme to retrieve the fields for |
options | object |
Returns
Promise<...> — The fields required for initiating a connected account
listCategories()
Retrieves all toolkit categories available in the Devcaster SDK.
This method fetches the complete list of categories from the Devcaster API and transforms the response to use camelCase property naming.
async listCategories(): Promise<...>Returns
Promise<...> — The list of toolkit categories
Example
// Get all toolkit categories
const categories = await devcaster.toolkits.listCategories();
console.log(categories.items); // Array of category objects