Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Build a bot that you can engage with inside Liveblocks.
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.
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.
@liveblocks/chat-sdk-adapter is Liveblocks' bridge that connects Liveblocks comment threads to the Chat SDK.@chat-adapter/state-memory provides the state layer that stores conversation context for the bot.commentCreated, commentReactionAdded, and commentReactionRemoved events.npx create-liveblocks-app@latest --example liveblocks-chat-sdk-bot --api-key to download the example and get an API key automatically.--vercel flag, or fork it on CodeSandbox with environment secrets.@liveblocks/chat-sdk-adapter works together with the Chat SDK and its state adapters.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.
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.
Enable commentCreated, commentReactionAdded, and commentReactionRemoved for the Liveblocks webhook endpoint, because the adapter needs these events to receive new comments and reactions.
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.
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.
