A chat bubble and a shared inbox for one website is a weekend: a widget script, a WebSocket server, an agent page, and SMTP plus IMAP for email. The gaps open after that: inbound mail that threads correctly, spam, WhatsApp and Instagram with their API approvals, and a mobile app for agents. Chatwoot's code is open under a mostly MIT licence and runs from Docker, so for most people the cheaper route is to host the same software on a small server and skip Cloud's per-agent fee. A build from scratch only makes sense if you want something much smaller.
Before you buildChatwoot's Hacker plan is free for two agents with live chat, and the Community Edition is free to self-host. Try either before building.
Build me a small support desk for my site to replace Chatwoot Cloud. Requirements: - Node.js 22 + TypeScript: a Fastify server with `@fastify/websocket` and a React inbox built with Vite. `npm start` serves http://localhost:4760: the inbox at /app and the widget at /widget.js. - Storage: better-sqlite3 in ./data/desk.db: contacts (email, name, custom attributes as JSON), inboxes (website widget, support email address), conversations (open, pending, snoozed, resolved; assignee; labels), messages (incoming, outgoing, private note, attachment paths), canned responses, agents. - Agents: up to 5, created with `npm run agent:add`, password hashed with argon2id, session cookie. Roles are admin and agent; only an admin edits inboxes, labels and canned responses. - Widget: one script tag shows a bubble in a Shadow DOM. The visitor id lives in localStorage, a pre-chat form asks for name and email, a dropped connection reconnects and re-sends unconfirmed messages, and outside business hours it shows an away message. - Email channel: poll IMAP with `imapflow` and thread on Message-ID, In-Reply-To and References. Replies go out through nodemailer with the same headers. Save attachments under ./data/files (10 MB each), sanitize HTML mail with `sanitize-html` and never load remote images. - Inbox: lists filtered by mine, unassigned, status and label; assign, label, add private notes, type "/" for canned responses; a side panel with the contact and its past conversations; resolve conversations idle for N days (setting). - Security: the widget only works from ALLOWED_ORIGINS, 20 messages a minute per visitor, 2,000 characters per message, everything escaped on output, secrets in .env. - Single team. No visitor accounts, no telemetry, local-first. Outbound calls: SMTP and IMAP. - Out of scope: WhatsApp, Instagram, SMS and voice channels, an AI assistant, mobile apps, SLAs, automation rules. - README: the embed snippet, the .env keys, a reverse proxy with WebSocket upgrade headers, SPF and DKIM for the support address, and a note that self-hosting Chatwoot already offers all of this.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Chatwoot Cloud.
Add a Chatwoot importer to the support desk in this folder. Requirements:
- A command `desk import-chatwoot` that takes CHATWOOT_URL, CHATWOOT_ACCOUNT_ID and CHATWOOT_TOKEN
(a personal access token) from .env.
- Page through GET /api/v1/accounts/{id}/contacts and /conversations with the api_access_token header
until a page comes back empty (check the current API reference for paging parameters), then fetch
each conversation's messages.
- Map contacts by email, conversations to the closest status, and messages to incoming, outgoing or
private note; keep original timestamps and sender names.
- Skip anything already imported, using the Chatwoot id as a stored external key, and print counts.
- Update the README with the rate limit I should respect and how to find the token.Add reply drafts to the support desk in this folder. Requirements: - Index the Markdown files in ./kb at startup (split by heading, embed with an OpenAI-compatible embeddings endpoint from .env, store vectors in SQLite). - A "Suggest reply" button in the inbox retrieves the 3 best-matching chunks for the latest customer message, asks the chat model for a draft that cites the article names, and puts the draft in the reply box without sending it. - Say "no matching article" instead of inventing an answer when the best match is weak. - Log which articles were used per conversation. - Update the README with what text leaves the machine.
Add a Telegram inbox to the support desk in this folder. Requirements: - Create a Telegram channel type with a bot token in .env and long polling through `grammy`. - Each Telegram chat becomes a contact and a conversation; incoming text, photos and documents appear in the inbox, and agent replies are sent back through the bot. - Show the channel icon in the conversation list and the contact panel. - Rate-limit replies to respect Telegram's limits and queue on failure with 3 retries. - Update the README with creating the bot in BotFather.
Cloud means nobody patches a server: Chatwoot runs the app, its database and Redis, the channel connectors and the mail sending, and a free tier lets two agents start at no cost. Self-hosting asks for at least 2 CPU cores and 4 GB of RAM and leaves updates, security and backups to you, which is the part a small team happily pays $19 a seat to skip.
Estimate · On your own machine it costs nothing; a public widget needs a VPS at about $5 a month. The build is token usage on your agent plan.
Checked 2026-10-19 against Chatwoot Cloud's docs: 1, 2, 3, 4, 5
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Hacker | $0 | $0 | Up to 2 agents, 500 conversations a month, live chat channel only, 30 days of data retention. |
| Startups | $19 | — | Unlimited conversations (fair use), all channels, help center, 300 Captain AI credits a month, 1 year of data retention. |
| Business | $39 | — | Adds voice, teams and automation rules; 500 Captain AI credits a month; 2 years of data retention. |
| Enterprise | $99 | — | Adds SSO/SAML and audit logs; 800 Captain AI credits a month; 3 years of data retention. |
Hacker is free for up to 2 agents with live chat only and 500 conversations a month; approved open-source projects can get Startups free on request.
Kinda. The core is a weekend build with the prompt on this page, but real gaps remain: WhatsApp, Instagram, Facebook, Telegram, SMS and voice channels, The iOS and Android apps for agents.
About $19 a month on the Startups plan per seat, $228 a year (checked 2026-10-19).
WhatsApp, Instagram, Facebook, Telegram, SMS and voice channels; The iOS and Android apps for agents; Teams, automation rules, SLAs and the built-in reports; The Captain AI assistant, copilot and reply suggestions; A help center whose articles show inside the chat widget. If any of those matter to you, keep paying.
Yes: Chatwoot (self-hosted) (open source), Libredesk (open source), Live Helper Chat (open source).