Build or buy chat? What building in-app chat yourself involves
Most of the work in adding a chat feature comes after the first message gets through. This guide gives you an overview of the work involved, sourced time and cost ranges, and when to choose which option.
Use a chat API and SDK when chat is a feature of your product, build it yourself when chat is your product.
Build vs buy chat at a glance
When you build chat yourself, you have full control over servers, code, data, and where the chat runs. Your team does all the building, running, and fixing. With a chat API and SDK, a vendor runs the servers, storage, and chat features for your app. The following table compares the two options on points that usually decide between them.
| Question | Build it yourself | Use a chat API (TalkJS) |
|---|---|---|
| What you own | Every server, the database, the code, and the data | Your app and its backend. TalkJS runs the chat servers and stores the messages |
| Time to a first version | Agency estimates for an MVP run from 10 weeks to 4 months (RaftLabs, ARKA Softwares) | A working chat within 5 minutes with a getting-started guide. Full integration time varies per project. Development mode is free, so you can try before committing |
| Ongoing work | Running, scaling, and patching every server and library. Traditional estimates put maintenance at about 60% of a system’s overall effort (BCS) | Your integration: the endpoint that signs user tokens, any webhooks, and your UI customizations |
| Control over data and UI | Full control over both data and UI | Data import and export API on every plan. Customize any part of the pre-built UI with theme components, or build your own UI on the Data APIs |
| Compliance | Whatever you certify your own systems for, at your own cost | ISO 27001 certified, GDPR compliant, with encryption at rest and in transit, on servers in the EU |
| Cost model | Developer time plus hosting. The US median software developer wage was $135,980 a year in May 2025 (BLS) | A monthly plan by monthly active users (MAU), from $239 a month billed annually for 10,000 MAU |
| Who fixes it when it breaks | Your team fixes everything | TalkJS engineers, with chat support on every plan, and a 24/7 emergency line on Enterprise |
Pros and cons of building chat yourself
Pros
- You have full control over every rule, screen, and data store.
- Messages live in your own database, next to the rest of your data.
- You're not dependent on a vendor who can raise prices, deprecate features, or shut the product down under you.
Cons
- Your team owns every access check, rate limit, and library patch, and a WebSocket server has to check authorization on every message, not only at connect (OWASP).
- Every server you add needs load balancing and message forwarding that your team sets up and runs.
- Reconnects, retries, and outages are yours to handle, after months of work before a first version.
Pros and cons of a chat API
Pros
- The servers, storage, notifications, moderation options, and UI are handled for you.
- The vendor handles security patches, scaling, and uptime on its servers, and its engineers fix what breaks there.
- Your team can go live fast instead of spending months on backend work before a first version.
Cons
- A monthly fee that grows with your users.
- You depend on a vendor’s roadmap: Twilio sunset its Programmable Chat API in 2022, and Pusher discontinued Chatkit in 2020.
Should you build chat in-house or use a chat API?
The choice between building and buying chat comes down mostly to whether chat is your product, or whether it's a feature of your product. As a middle way between building and buying, you could use realtime message delivery infrastructure while building the chat features yourself.
Build it yourself
Building fits when chat is the product you sell, and your team is ready to build, run, and fix it for as long as the product exists. It also fits when your chat needs rules that no vendor offers.
Use a chat API
A chat API fits when chat supports the product you sell, such as messages between buyers and sellers on a marketplace. The vendor runs the chat backend, and you choose the UI: its pre-built chat UI, styled to match your app, or your own screens on its data APIs. With TalkJS, those are the UI components and the Data APIs.
Build on realtime infrastructure
Realtime infrastructure, such as Ably Pub/Sub, Pusher Channels, or Firebase, delivers the messages between your users. Your team still builds the chat features and the screens on top of it, such as conversations, access control, and notifications (see TalkJS vs Firebase).
To choose between chat API and SDK providers, see the best chat APIs and SDKs.
What does building in-app chat involve?
A WebSocket library can get a message from one connected user to another, but in-app chat needs far more than message delivery. Here's an overview of what you run in a self-built chat, compared with what you run when you're using a chat provider.
Message history and search
To store and load message history in a self-built chat, you’d build a message store, an API that loads older messages a page at a time, and search if your users need it. Without a message store, messages are gone after a reload, and long conversations load slowly.
With TalkJS, every plan includes unlimited conversations, messages, and message history. Message search is included on the Growth plan and up (see pricing).
Access control
Access control in a self-built chat has two parts. Identity proves that each user is who they say they are. A membership check on the server confirms that a user belongs in a conversation before they read or send anything in it. The WebSocket protocol gives you neither, because WebSockets don’t have built-in authentication (OWASP). Without the membership check, anyone who knows or guesses a conversation ID can read that conversation.
With TalkJS, users connect with a token your backend signs, and once you turn on authentication, TalkJS rejects users without a valid token.
Offline and bad networks
On a bad network, a self-built chat has to reconnect, retry failed sends without duplicates, and deliver what a user missed while they were offline. Socket.IO, for example, delivers each event at most once by default, and any further delivery guarantees “must be implemented in your application”. Without reconnects, retries, and catch-up delivery, messages sent in a tunnel or on a train are lost.
With TalkJS, a message sent while offline is queued and retried when the connection returns, and the UI shows Sending until it goes through.
Scaling past one server
Scaling a self-built chat past one server means a message has to reach users connected to the other servers too. For example, two things to take care of when you run several servers are load balancing, such as sticky sessions, and forwarding messages between the servers (Socket.IO). Without message forwarding, users on different servers stop seeing each other’s messages. Reconnects add load of their own: in Discord’s March 2026 voice outage, session resumption happened “not for one session, but for 17% of our total sessions”.
With TalkJS, you don’t run chat servers, so there’s no load balancing or message forwarding to set up.
Read state and presence
Read state in a self-built chat covers unread counts per user and conversation, read and delivery receipts, typing indicators, and online status. Each one is state that changes often and has to reach every participant. Without read receipts, users can’t tell whether anyone saw their message.
With TalkJS, read and delivery receipts, typing indicators, online status, and unread counts are all built in.
Notifications
Notifications in a self-built chat start with a way to tell who’s offline. Then you send email, SMS, or push notifications through providers such as Apple Push Notification service (APNs) and Firebase Cloud Messaging (FCM). Without notifications, a reply waits unseen until the user opens your app again.
With TalkJS, email, SMS, browser, and mobile push notifications are included on every plan. User replies to email notifications get synced back into the chat. SMS is charged separately.
Moderation
Moderating a self-built chat takes word filters, masking for email addresses and phone numbers, a way for users to report a message, and tools for whoever handles the reports. Without moderation, spam and abuse stay in the chat.
With TalkJS, contact masking, word filters, and custom suppression patterns are included on every plan (see Moderation).
Rich messages
The message features users expect include replies, reactions, edits and deletes, link previews, mentions, voice messages, and file uploads with storage. In a self-built chat, each feature needs a data model, an API, and a piece of UI. Without these features, the chat feels behind compared to contemporary messaging apps on your users’ phones.
With TalkJS, replies, reactions, edits, deletes, link previews, mentions, voice messages, and files up to 100 MB are included (see Messages).
Chat UI
The chat UI of a self-built chat is the message list, the composer, the conversation list, and theming, built once for each platform you ship on: web, iOS, and Android. The UI is the part your users see, so it’s also where they notice every missing detail.
With TalkJS, you get fully customizable pre-built chat UIs for React, Web Components, Flutter, and React Native. Use the Data APIs to build your own screens.
Keeping chat running
Keeping a self-built chat running is work that doesn’t end: deploys that drop open connections, waves of reconnects after a restart, monitoring, and patching the libraries you depend on. Retries can turn a small fault into an outage: Slack’s review of its February 2022 incident says “Client retries are often a contributor to cascading failures”. Popular WebSocket libraries need patching too: ws and the Socket.IO parser have both had high-severity bugs that let one crafted request crash the server (CVE-2024-37890, CVE-2023-32695).
With TalkJS, running the chat servers is TalkJS’s job. TalkJS engineers answer chat support on every plan, while the Enterprise plan adds an uptime SLA and a 24/7 emergency line (see plans and support).
Group chat and buyer-seller chat
Group chats and marketplaces add work on top of one-on-one chat. For group chat, you decide what people see when they join (the history before they joined, or not), keep unread counts for every member, and handle large groups. For buyer-seller chat on a marketplace, you mask contact details so deals stay on your platform, keep one conversation per order, and give a moderator a way into disputes.
With TalkJS, you can have group chats with contact masking and moderator Read access on every plan (see chat for online marketplaces).
Build checklist: what an in-house chat needs
Planning to build your own chat? Use this checklist to plan what you need, or to check a chat API against. Tick any item you want, then copy the list as Markdown into a ticket or a planning doc.
What does it cost to build and run chat yourself?
Building a first version of a chat feature is one thing. Running, maintaining, and securing that chat at scale takes far more effort, which your team could otherwise spend on product work. Here’s what it costs to build and run chat yourself, beyond delivering the first message.
Initial build
Estimates for building a chat feature yourself run from weeks to months, and the cost can reach tens of thousands of dollars. The cards compare rough estimates for a basic messaging MVP and a full messaging app.
- Cost (ARKA Softwares)
- $15,000–$22,000
- Time (ARKA Softwares)
- 3–4 months
- Cost on one platform, at $50 an hour (Addevice)
- $30,000–$70,000
- Time for an enterprise app (ARKA Softwares)
- 6–9 months
- Minimum development time for a WhatsApp-like app (Django Stars)
- 550+ hours
Maintenance
Maintenance of a self-built chat continues for as long as the chat is live. Traditional estimates put maintenance at about 60% of a system’s overall time and effort (BCS, The Chartered Institute for IT, 2007). In Stripe’s Developer Coefficient survey with Harris Poll (September 2018), respondents estimated that developers at their company spend 17.3 hours of a 41.1-hour week on maintenance.
Developer pay sets the price of that maintenance time. The median US software developer wage was $135,980 a year in May 2025 (US Bureau of Labor Statistics), base wage only. The 2025 Stack Overflow Developer Survey puts US median pay at $175,000 for back-end, $170,000 for mobile, $145,000 for front-end, and $138,000 for full-stack developers.
Security and compliance
Security and compliance for a self-built chat are your team’s job: access checks, rate limits, library patches, penetration tests, and any audits your customers ask for, such as SOC 2. The stakes are high. Broken access control tops the OWASP Top 10:2025, which found some issues with access control in “100% of the applications tested”. The global average cost of a data breach was $4.99 million in IBM’s Cost of a Data Breach Report 2026, based on breaches at 602 organizations.
Infrastructure
Infrastructure for a self-built chat is usually the smaller cost next to your team’s time, and cloud providers publish their prices. Amazon’s own API Gateway pricing example for a chat app, with 1,000 users connected 12 hours a day, comes to $23.40 a month for messages and connections in US East (as of November 2026). A database, pub/sub layer, and file storage come on top. Email notifications through Amazon SES cost $0.10 per 1,000 emails, Firebase Cloud Messaging is listed as no-cost, and push notifications for Apple devices are part of the Apple Developer Program, at $99 a year.
Opportunity cost
The opportunity cost of building chat is the product work your team doesn’t do while it builds, runs, secures, and maintains the chat. Every hour in the estimates given, and every maintenance hour after launch, is an hour your team doesn't spend on the features that set your product apart.
Can an AI coding agent build your chat?
An AI coding agent can write a first version of your chat faster. However, building a minimal chat fast doesn’t change who runs the chat afterwards. Whether you work with an agent or vibe code the chat, your team still secures it, keeps it running, and fixes it when it breaks, along with every area in what building in-app chat involves. In that light, it's safest to base your build-or-buy decision on the running costs, which an agent doesn’t lower.
To have your coding agent add TalkJS to your app instead of building chat from scratch, point it at talkjs.com/SKILL.md.
Moving from a self-built chat
Prefer not to build and run a chat feature yourself? To move from a self-built chat to TalkJS, you import your app's message history through the REST API, in this order:
- Users
- Conversations, with their participants
- Messages, with their original timestamps
Imported messages don’t send notifications, so your users aren’t flooded with old messages. For detailed steps, see Import messages.
Talk to an engineer
If you’re weighing building against buying, or planning a move from your own chat, TalkJS engineers are here to support you.
FAQs
Use a chat API if chat is a feature of your product: the vendor runs the servers, storage, notifications, moderation, and chat UI, and your team skips months of building. Build it yourself if chat is your product, or if you need what only your own code gives you: full control of the server logic and data model, messages in your own database, and no dependence on a vendor’s roadmap.
Published agency estimates for building in-app chat run from 10 to 16 weeks for a messaging MVP (RaftLabs, updated November 11, 2026) to 6 to 9 months for an enterprise chat app (ARKA Softwares, undated 2026 guide). Maintenance comes on top: traditional estimates put it at about 60% of a system’s overall time and effort (BCS, 2007).
Agency estimates for building a chat app run from $15,000–$22,000 for an MVP (ARKA Softwares) to $30,000–$70,000 for a full messaging app on one platform, at $50 an hour (Addevice). They differ with the team’s location and hourly rate, and with the features in scope. For an in-house team in the US, the median software developer wage was $135,980 a year in May 2025 (US Bureau of Labor Statistics).
Most of the effort goes into the work around each message: reaching users who were offline, checking who may read a conversation, notifying people, moderating content, running more than one server, and building the chat UI for each platform. What building in-app chat involves covers each area.
An agent can write a first version faster, but your team still runs, secures, and fixes the chat after launch, so the running costs don’t change. For an agent that adds TalkJS to your app instead, see talkjs.com/SKILL.md.
There are three, ordered by how much work they leave with your team. A chat API with a pre-built UI leaves the least. A chat API with your own UI, such as the TalkJS Data APIs, leaves the screens. Realtime infrastructure, such as Ably Pub/Sub, Pusher Channels, or Firebase, delivers the messages and leaves the chat features and screens.
Yes. TalkJS imports your existing users, conversations, and message history, with the original timestamps, through the REST API, and imported messages don’t notify anyone. The steps are under Moving from a self-built chat.
Yes, TalkJS is free to build with. Development mode has no limits. You pay when you go live: the Basic plan is $239 a month, billed annually, for 10,000 monthly active users.
Try TalkJS before you decide
Development mode is free and has no limits, so you can check TalkJS against the checklist above in your own app. When you go live, plans start at $239 a month, billed annually, for 10,000 monthly active users.