Articles · GuideUpdated November 2026

How to add chat to your app.
Describe it, ship real code.

By , Founder, Newly

The short version of how to add chat to your app with Newly: you describe the messaging you want in a sentence, and the AI builds it. No chat SDK to bolt on, no schema to design by hand. One catch most guides skip, so we put it up front below: live updates take a deliberate choice, and we tell you exactly which one.

The five steps

The five steps to add chat.

Here is how to add chat to your app in Newly, start to finish. Five steps. Four of them are you describing and refining; only the last one asks you to actually decide something.

  1. 1

    Describe the chat you want

    Open your Newly project and tell the AI what messaging should do, in your own words: one-to-one threads, a group channel, a support inbox, a chatbot. Name the behaviour you care about. Who can start a conversation? What does a thread show? Do messages need timestamps? The sharper the description, the closer the first pass lands. This is the whole interface to how to add chat to your app in Newly. Plain language, no schema editor.

  2. 2

    Newly generates the data model

    From that one description, the schema appears: a conversations table and a messages table, wired together so each message points back at its thread and the inbox can sort by recent activity. The next section breaks down every field. For now, the thing to know is that it persists in Newly Backend, so your history is durable from the very first message rather than living in memory.

  3. 3

    REST endpoints get wired up

    The tables need routes, so Newly writes them: create a conversation, list a user's conversations, read a thread, post a message. These hit your real Postgres data, not a mock. The client calls them to open a thread, send, and refresh. That request-and-response rhythm is plain REST, and it carries the large majority of messaging products without anyone noticing.

  4. 4

    The chat UI lands on your phone

    The screens come too: an inbox of conversations and a thread view with a scrolling history and a text box at the bottom. Preview it on your actual phone, fire off a few test messages, watch them stick. Since the screens are React Native code rather than a configured widget, you can rename them, restyle them, or tear them apart.

  5. 5

    Refine, then decide on live updates

    Keep iterating in plain language: avatars, read indicators, group threads or a longer history. Tell the agent how quickly new messages should appear. It builds the update behavior into your app and API, and you test the result with separate accounts and devices.

Chat, at a glance.

2 tables

conversations and messages, the whole chat data model Newly generates

4 endpoints

create and list conversations, get and post messages, all REST

Hosted

Newly hosts your app’s message database and API

REST

the API handles messages; describe the update behavior you need

What you get

The chat feature and the React Native code.

Describe the messaging feature you want. The agent writes the React Native screens, adds Newly Backend and connects the API and message database. Newly hosts the backend, and you keep the source code.

Chat arrives as code you can open and read. To change how a thread renders or rename a field, you edit the files directly.

Newly Backend hosts your messages and API. Describe when conversations should refresh and test that behavior with two accounts.

The data model

The two tables behind the chat.

A messaging feature comes down to two related tables with a few endpoints on top. Here is the exact shape Newly produces, field by field, so you know what you are getting before you ask for it.

conversations

One row per thread.

  • idUnique identifier for the conversation.
  • user_idWho owns or started the thread.
  • titleA label for the thread in the inbox.
  • last_message_atTimestamp used to sort the inbox by recent activity.

messages

One row per message.

  • idUnique identifier for the message.
  • conversation_idLinks the message back to its thread.
  • roleMarks who sent it: a user, or an assistant.
  • contentThe message text itself.
  • created_atTimestamp used to order the thread.

And four REST endpoints on top.

Four routes drive those tables: create a conversation, list a user’s conversations, read a thread, post a message. Create, list, read, write – that is the entire surface a chat client touches, nothing extra to learn. Outgrow it and you just ask for more. Attachments, reactions, soft deletes: describe the field and the model grows to fit.

The honest part

REST by default. Live when you need it.

The agent builds message refresh behavior into your app and connects it to the API on Newly Backend. Ask for updates when a thread opens, after sending and while the conversation stays visible. Tell the agent how quickly other users should see new messages.

For most messaging that is plenty. Support threads, comment inboxes, and slower one-to-one conversations feel right on REST, because nobody is waiting on the millisecond. If you want a message to land on someone else’s screen the instant it is sent, you have two paths below: a fast refresh on the open thread, which covers most chats, or true live delivery that the agent plans with you.

REST chat is great for

  • Support and helpdesk threads
  • Comment threads and feedback inboxes
  • Slower one-to-one conversations
  • Anything that refreshes fine on open, send, and pull-to-refresh
  • Most messaging in most apps, honestly

Reach for live updates when

  • Two people typing to each other live
  • A message must appear without any refresh
  • Typing indicators and presence dots
  • Live order tracking or multiplayer state
  • The instant-delivery feel of a dedicated chat app
1

Refresh an open conversation

Your app’s API

Ask the agent to refresh a thread when it opens, after sending and at a suitable interval while it stays visible. This uses your app’s API and works for support threads or slower conversations. Stop refreshes when the app is inactive and test reconnection behavior.

Best when. Support threads and conversations that work with periodic refreshes.

2

Plan live delivery

Check server and client requirements

Describe the live behavior you need and ask the agent to explain its proposed implementation. A live messaging service or persistent connection needs its own server support, authentication and reconnect handling. Check those requirements against the backend services before using the feature in production.

Best when. Conversations that need immediate updates while the screen is open.

Test delivery after reconnecting.

A live messaging feature needs reconnect handling, authentication and a way to catch up after the app becomes active again. Both WebSockets and event streams depend on app state and network conditions. Ask the agent to explain the proposed transport and test it across backgrounding and network changes.

Newly vs hand-coding

Building chat by hand vs with Newly.

Doing how to add chat to your app the hand-coded way is a fair bit of work. You design the schema, write the endpoints and version them, lock down auth so one user never reads another’s threads, then build the client-side state sync that keeps the UI consistent as messages come and go. Most of it is plumbing, and every bit of it has to be correct.

Newly handles that work and hands back the generated code, which you can keep editing. The conversations and messages tables, the endpoints, and the chat UI are all in place from the start.

The trade-off is straightforward. Newly is paid, from $25 a month, and in exchange you skip the boilerplate and start from a chat feature already running on your phone.

FAQ

How to add chat to your app, in plain language.

You describe it. Tell Newly something like “add one-to-one messaging so users can start a conversation and send messages back and forth,” and the AI builds the whole feature: a data model with a conversations table and a messages table, the REST endpoints to create and list conversations and to read and post messages, and the chat screens, a conversation list and a thread view with a text input. Messages persist in Newly Backend, the backend bundled with every Newly subscription, so the history survives a refresh and a reinstall. You get a working chat feature on your phone and the React Native and Expo code behind it, from $25 a month. From there you refine in plain language: avatars, group threads, read receipts, timestamps. No separate chat SDK to wire up, no schema to design by hand.

Describe the chat. Ship the real thing.

Describe the messaging you want and the agent builds the app and backend. Newly hosts the message database and API. Tell the agent how quickly messages should appear, then test delivery on two devices and after reconnecting.