Full Stack Chat App
In this example, you will learn how to build a chatbot that:
- Lets users connect their various apps to the chatbot using the Composio SDK.
- Uses the Vercel provider in the Composio SDK to handle and execute tool calls from the LLM.
This page gives a high-level overview of the Composio SDK and how it is used in the GitHub repository: composiohq/chat.
You can find the demo live here.
Prerequisites
Ensure you’ve followed the README.md in the composiohq/chat repository to set the project locally.
Creating auth configs
For all the apps you want to connect to the chatbot, you need to create their respective auth configs.
Learn how to create auth configs here.
Once done, your auth configs will be available in the Composio dashboard.

Save auth config IDs to environment variables
For this project, the auth config IDs should be saved the the environment variables with the NEXT_PUBLIC_
prefix.
Create a Composio client instance
We create a Composio client instance for server-side operations like, API routes, server components, etc.
Creating an API for fetching toolkits
The Composio SDK is meant to be used only in server-side code. For client-side functionality, we create API endpoints in the /app/api/
directory.
In order to list the toolkits and their connection status, we create a Next.js API route to fetch the toolkits using Composio SDK.

1. Listing connected accounts
First, we fetch all connected accounts for a user and create a mapping of toolkit slugs to their connection IDs:
2. Fetching toolkit data and building response
Next, we fetch toolkit information for each supported toolkit and combine it with the connection status:
Managing connections
Users need to connect and disconnect their accounts from the chatbot to enable tool usage. When users click “Connect” on a toolkit, we initiate an OAuth flow, and when they click “Disconnect”, we remove their connection.
1. Initiating a connection
When a user wants to connect their account, we create a connection request that redirects them to the OAuth provider:

2. Checking connection status
After initiating a connection, we need to wait for the OAuth flow to complete. We check the connection status to know when it’s ready to use:

3. Deleting a connection
When a user wants to disconnect their account, we remove the connection using the connection ID:
Working with tools
Once users have connected their accounts, we need to track which toolkits are enabled and fetch the corresponding tools for the LLM.
1. Tracking enabled toolkits
We keep track of which toolkits the user has enabled in the chat interface:
2. Fetching tools for enabled toolkits
We fetch Composio tools based on the enabled toolkit slugs:
Bonus: Creating custom component to show tool calls
By default, tool calls appear as raw JSON in the chat interface. To create a better user experience, we can build custom components that display tool calls with proper formatting and loading states.

You can find the ToolCall
component at components/tool-call.tsx
. Here’s how to integrate it into your message rendering: