This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated. # Releases ## @composio/core@0.10.0 ### Minor Changes -42ebff3: feat(connected-accounts): namespace SHARED-connection surface under `experimental` Aligns the TypeScript SDK with the experimental wire shape used by Shared Connections. The flat `accountType` / `aclConfigForShared` options on `connectedAccounts.link()` and `session.authorize()` have moved under a single `experimental` block, and `connectedAccounts.updateAcl()` has moved off the class onto a top-level `experimental_updateAcl(composio, id, opts)` export — same precedent as `experimental_createTool` / `experimental_createToolkit`. The `experimental` namespace is the signal that the shape may change in future releases. Pinning a SHARED connection in a session config (`connectedAccounts: { gmail: [...] }`) and direct execute by `connectedAccountId` are unchanged — only the connection-create / patch / authorize surfaces are namespaced. Also surfaces the `accountType` filter on `connectedAccounts.list()` so SHARED connections can be listed without dropping to the raw client. The wire keeps this as a flat query param, so the SDK keeps it flat too. `@composio/client` bumped from `0.1.0-alpha.71` → `0.1.0-alpha.72` so the generated typed client carries the `Experimental` namespaces for `link.create`, `toolRouter.session.link`, and `connectedAccounts.patch`. Caller migration: ```typescript // before await composio.connectedAccounts.link('user_id', 'auth_config_id', { accountType: 'SHARED', aclConfigForShared: { allowAllUsers: true }, }); await composio.connectedAccounts.updateAcl('ca_abc', { allowAllUsers: true }); await session.authorize('github', { accountType: 'SHARED', aclConfigForShared: { allowAllUsers: true }, }); // after await composio.connectedAccounts.link('user_id', 'auth_config_id', { experimental: { accountType: 'SHARED', aclConfigForShared: { allowAllUsers: true }, }, }); await experimental_updateAcl(composio, 'ca_abc', { allowAllUsers: true }); await session.authorize('github', { experimental: { accountType: 'SHARED', aclConfigForShared: { allowAllUsers: true }, }, }); // new — list SHARED connections const shared = await composio.connectedAccounts.list({ accountType: 'SHARED', userIds: ['user_creator'], }); ``` ## @composio/cli-local-tools@0.0.4 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/anthropic@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/claude-agent-sdk@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/cloudflare@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/google@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/langchain@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/llamaindex@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/mastra@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/openai@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/openai-agents@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/vercel@1.0.0 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 ## @composio/cli@0.2.30 ### Patch Changes - Updated dependencies [42ebff3] - @composio/core@0.10.0 - @composio/cli-local-tools@0.0.4 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
Composio SDK v3
The Composio SDK is a powerful toolkit that enables you to integrate third-party tools and services into your applications. It helps you connect to various services (toolkits), execute tools, and manage user connections seamlessly.
Features
- Execute tools from various services (GitHub, Gmail, Slack, etc.)
- Manage user connections to external services
- Create custom tools with your own logic
- Integrate with AI providers like OpenAI
- Powerful middleware and modifier support
- Extensive error handling
Documentation
The SDK is thoroughly documented in the docs directory:
- Overview - Introduction and key concepts
- Getting Started - Quick start guide
- Core Concepts - Fundamental SDK concepts
- Configuration - Environment variables and SDK configuration
API Reference
- Composio Class - Main SDK class
- Tools - Using and creating tools
- Toolkits - Working with tool collections
- Connected Accounts - User authentication
- Auth Configs - Authentication configuration
- Custom Tools - Creating your own tools
- Providers - AI integration options
Provider Documentation
- OpenAI Provider - Using OpenAI with Composio
- Google Provider - Using Google GenAI with Composio
- Custom Providers - Creating new providers
Advanced Topics
- Error Handling - Managing errors
- Middleware and Modifiers - Customizing tools
- Telemetry - SDK usage tracking
- Custom Providers - Detailed provider guide
Internal Documentation
For SDK maintainers and contributors:
- Configuration and Environment Variables - Detailed guide on SDK configuration
- Triggers Implementation - Internal workings of the trigger system
Installation
# Using npm
npm install @composio/core
# Using yarn
yarn add @composio/core
# Using pnpm
pnpm add @composio/core
Quick Start
import { Composio } from '@composio/core';
// Initialize the SDK
const composio = new Composio({
apiKey: 'your-api-key',
});
// Get tools from a specific toolkit
const tools = await composio.tools.get('default', {
toolkits: ['github'],
});
// Get a specific tool
const specificTool = await composio.tools.get('default', 'GITHUB_GET_REPOS');
// Execute a tool
const result = await composio.tools.execute('GITHUB_GET_REPO', {
userId: 'default',
arguments: {
owner: 'composio',
repo: 'sdk',
},
});
console.log(result.data);
OpenAI Integration
import { Composio } from '@composio/core';
import OpenAI from 'openai';
// Initialize Composio and OpenAI
const composio = new Composio({
apiKey: 'your-composio-api-key',
});
const openai = new OpenAI({
apiKey: 'your-openai-api-key',
});
// Get GitHub tools
const tools = await composio.tools.get('default', {
toolkits: ['github'],
});
// Create a chat completion with the tools
const completion = await openai.chat.completions.create({
model: 'gpt-4',
messages: [
{ role: 'system', content: 'You are a helpful assistant with access to GitHub tools.' },
{ role: 'user', content: 'Find information about the Composio SDK repository' },
],
tools, // Pass the tools to OpenAI
});
// If the model wants to use a tool
if (completion.choices[0].message.tool_calls) {
const toolCall = completion.choices[0].message.tool_calls[0];
const args = JSON.parse(toolCall.function.arguments);
// Execute the tool
const result = await composio.tools.execute(toolCall.function.name, {
userId: 'default',
arguments: args,
});
console.log(result.data);
}
Creating Custom Tools
import { z } from 'zod';
// Create a custom tool
const customTool = await composio.tools.createCustomTool({
name: 'Weather Forecast',
description: 'Get the weather forecast for a location',
slug: 'WEATHER_FORECAST',
inputParams: z.object({
location: z.string().describe('The location to get the forecast for'),
days: z.number().optional().default(3).describe('Number of days for the forecast')
}),
execute: async (input) => {
try {
const { location, days = 3 } = input;
// Your implementation here
const forecast = [
{ date: '2025-05-21', temperature: 72, conditions: 'Sunny' },
{ date: '2025-05-22', temperature: 68, conditions: 'Partly Cloudy' },
{ date: '2025-05-23', temperature: 65, conditions: 'Rainy' },
];
return {
data: { forecast },
successful: true,
error: null,
};
} catch (error) {
return {
data: {},
successful: false,
error: error.message,
};
}
},
});
Project Structure
composio/
├── packages/ # Main packages directory
│ ├── core/ # Core SDK package
│ └── providers/ # Provider implementations
├── examples/ # Example implementations
│ ├── connected-accounts/ # Connected accounts examples
│ ├── langchain/ # LangChain integration examples
│ ├── openai/ # OpenAI integration examples
│ ├── modifiers/ # Modifiers examples
│ ├── toolkits/ # Toolkits examples
│ └── vercel/ # Vercel AI examples
├── docs/ # Documentation
├── scripts/ # Development and build scripts
└── .github/ # GitHub configuration
Development Setup
-
Prerequisites
-
Clone and Install
git clone https://github.com/ComposioHQ/sdk-v3-ts.git cd composio pnpm install -
Build
pnpm build -
Development Commands
# Lint code pnpm lint # Fix linting issues pnpm lint:fix # Format code pnpm format # Create a new provider pnpm create:provider <provider-name> [--agentic] # Create a new example pnpm create:example <example-name> # Check peer dependencies pnpm check:peer-deps # Update peer dependencies pnpm update:peer-deps
Creating a New Example
-
Use the create:example script:
pnpm create:example my-example -
The script will create a new example in
examples/my-examplewith:package.jsonwith minimal dependencies (@composio/coreanddotenv)tsconfig.jsonfor TypeScript configuration.env.exampleand.envfiles for environment variablessrc/index.tswith basic Composio SDK setupREADME.mdwith setup and usage instructions- Dependencies automatically installed
-
Next steps after creation:
- Edit
.envand add yourCOMPOSIO_API_KEY - Customize
src/index.tswith your example logic - Add any additional dependencies as needed
- Run with
pnpm startorpnpm dev(with file watching)
- Edit
Creating a New Provider
-
Use the create:provider script:
pnpm create:provider my-provider [--agentic] -
The script will create a new provider in
packages/providers/my-providerwith:- Basic provider implementation
- TypeScript configuration
- Package configuration
- README template
-
Implement the required methods in
src/index.ts:- For non-agentic providers:
wrapToolandwrapTools - For agentic providers:
wrapTool,wrapTools, and execution handlers
- For non-agentic providers:
Release Process
For detailed information about both automated and manual release processes, please refer to our Release Process Documentation.
Environment Variables
COMPOSIO_API_KEY: Your Composio API keyCOMPOSIO_BASE_URL: Custom API base URL (optional)COMPOSIO_LOG_LEVEL: Logging level (silent, error, warn, info, debug)COMPOSIO_DISABLE_TELEMETRY: Disable telemetry when set to "true"COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>: Specific version for a toolkit (e.g.,COMPOSIO_TOOLKIT_VERSION_GITHUB=20250902_00)DEVELOPMENT: Development mode flagCI: CI environment flag
Contributing
We welcome contributions! Please see our Contributing Guide for more details.
License
ISC License
Support
For support, please visit our Documentation or join our Discord Community.