Chat SDK Liveblocks Bot is a Next.js example from Liveblocks that demonstrates building a bot which replies inside Liveblocks comment threads using the Chat SDK and the official Liveblocks platform adapter.
What is the Chat SDK Liveblocks Bot?
This starter project combines Liveblocks' realtime comment infrastructure with the Chat SDK so developers can build a bot that participates in comment threads. It takes a Liveblocks API key and webhook secret as configuration inputs and produces a running Next.js app where users can @-mention the bot or add reactions to messages. The example is maintained by Liveblocks and lives in the official liveblocks GitHub repository.
What makes it stand out?
- Thread-based bot replies — When a user @-mentions the bot in a comment thread, the bot replies directly in that thread using the Chat SDK.
- Reaction-based triggers — Adding a reaction to a message also triggers a short reply from the bot.
- Official platform adapter —
@liveblocks/chat-sdk-adapteris Liveblocks' bridge that connects Liveblocks comment threads to the Chat SDK. - State memory integration —
@chat-adapter/state-memoryprovides the state layer that stores conversation context for the bot. - Next.js UI — The example UI runs on Next.js, with Liveblocks handling realtime presence, comments, and notifications.
- Webhook-driven events — It requires Liveblocks webhooks and listens for
commentCreated,commentReactionAdded, andcommentReactionRemovedevents. - One-command setup — Run
npx create-liveblocks-app@latest --example liveblocks-chat-sdk-bot --api-keyto download the example and get an API key automatically. - Multiple deployment options — You can run it locally, deploy to Vercel with the
--vercelflag, or fork it on CodeSandbox with environment secrets.
Who should use the Chat SDK Liveblocks Bot?
- Developers building collaborative apps — Use this as a reference for wiring a bot into Liveblocks comment threads.
- Teams prototyping AI chat assistants — The adapter setup shows how to connect an AI response flow to realtime comments.
- Liveblocks users exploring the Chat SDK — See how
@liveblocks/chat-sdk-adapterworks together with the Chat SDK and its state adapters.
Use cases
- Customer support tooling — A bot can answer common questions in comment threads without leaving the app.
- Moderation helpers — Reaction-based triggers can be adapted to flag or automatically respond to messages.
- AI copilots — Embed an assistant that replies to @-mentions in collaborative documents and discussions.
How does the Chat SDK Liveblocks Bot work?
The example listens for comment and reaction events through Liveblocks webhooks. When a commentCreated or commentReactionAdded event arrives, @liveblocks/chat-sdk-adapter translates it into a Chat SDK event, the bot logic processes the message using the @chat-adapter/state-memory state adapter, and the reply is posted back into the same thread via Liveblocks comments.
FAQ
Do I need a Liveblocks account to run this example?
Yes. The setup commands ask for an API key from your liveblocks.io account, and webhook configuration requires a webhook secret from the Liveblocks dashboard.
What webhook events must be enabled?
Enable commentCreated, commentReactionAdded, and commentReactionRemoved for the Liveblocks webhook endpoint, because the adapter needs these events to receive new comments and reactions.
Can I deploy this bot to Vercel?
Yes. The command npx create-liveblocks-app@latest --example liveblocks-chat-sdk-bot --vercel downloads the example and guides you through deploying to Vercel. After deployment, point your webhook endpoint at the production URL.
What environment variables are required?
You need LIVEBLOCKS_SECRET_KEY for the secret API key. If you set up webhooks, you also need LIVEBLOCKS_WEBHOOK_SECRET with the webhook secret.








