For apps

A chat API and SDK for your app

Add chat to Next.js, Laravel, Django and any other stack: conversations between two people and group chats, with typing, who is online, read ticks, reactions and files. The ready-made chat works as it is on the web, messages reach everyone in the conversation at once, and your server keeps them in your own database.

Or try the live demo: a small shop where a customer writes to the shop, each in a window of their own.

The best pricing for WebSockets, unlimited 1-to-1 calls with TURN servers worldwide, and group calls and live streaming with an allowance included. From $11.99 a month for 1,000 concurrent connections, billed yearly, or $14.99 billed monthly.

Your server

Next.js on the server, and React on the page.

lib/realtime.ts
// What every chat carries: what pages send, what your webhook
// gets to keep, and the last 50 for a page that reconnects.
const chat = {
    emit: [ 'message', 'typing', 'read', 'reaction' ],
    webhook: [ 'message', 'reaction' ],
    history: 50,
};

// Two people, such as chat:34:42: the two in its name alone.
realtime.room( 'chat:{pair}', chat );

// A group, such as group:7: its members, who see each other.
realtime.room(
    'group:{id}',
    ( user, { id } ) => isMemberOf( id, user ),
    { ...chat, presence: true },
);
Your app

Hooks and components for any React app, on any of the servers above.

components/Conversation.jsx
'use client';   // in Next.js

import { Chat, RealtimeUi } from '@wordplus/realtime/react';

// Inside <RealtimeProvider>, once for the whole app.
export function Conversation() {
    return (
        <>
            <RealtimeUi />
            <div style={ { height: 520 } }>
                <Chat room="chat:34:42" to={ 34 } name="Ann" />
            </div>
        </>
    );
}
A conversation between two people, one of them typing

Your messages

Your messages stay in your database

We carry a conversation, and your server keeps it. A room holds its last events for about five minutes, only so a page that reconnects misses nothing, and your database holds the conversation itself.

At once, on every device

A message goes from page to page through our servers as it is sent, with no request to yours, to every tab and app of everyone in the conversation.

Kept by your server

Your webhook gets each message and reaction as it is sent, and keeps it in your own database. Your own route gives the chat its history as it opens, so the conversation is yours to search, moderate and show again.

Sealed on the way

A private conversation travels sealed with keys your server makes: its messages, its history and who is in it. The cloud carries it without being able to read it.

Your server decides

Build a chat, a task at a time

A chat is a room: chat:34:42 for Ben writing to Ann, who sells, or group:7 for a group. One rule on your server says who is in it, and the pages send each other messages, typing and read ticks through it. Here are both, from the ready-made chat to a call.

Your server

Next.js on the server, and React on the page.

Add the ready-made chat

One rule on your server for each kind of chat: a chat of two lets in the two people its name holds, and a group its members, reading your own data. Then the chat goes in the page, with typing, read ticks and reactions. isMemberOf is your own lookup.

lib/realtime.ts
// What every chat carries: what pages send, what your webhook
// gets to keep, and the last 50 for a page that reconnects.
const chat = {
    emit: [ 'message', 'typing', 'read', 'reaction' ],
    webhook: [ 'message', 'reaction' ],
    history: 50,
};

// Two people, such as chat:34:42: the two in its name alone.
realtime.room( 'chat:{pair}', chat );

// A group, such as group:7: its members, who see each other.
realtime.room(
    'group:{id}',
    ( user, { id } ) => isMemberOf( id, user ),
    { ...chat, presence: true },
);
Your app

Hooks and components for any React app, on any of the servers above.

components/Conversation.jsx
'use client';   // in Next.js

import { Chat, RealtimeUi } from '@wordplus/realtime/react';

// Inside <RealtimeProvider>, once for the whole app.
// In the page of Ben, writing to Ann.
export function Conversation() {
    return (
        <>
            <RealtimeUi />
            <div style={ { height: 520 } }>
                <Chat room="chat:34:42"
                      to={ 34 }
                      name="Ann" />
            </div>
        </>
    );
}

A call from the chat is a call between two people: our video call API has everything a call does.

Chat in each stack, with the whole setup:

Where it runs

The ready-made chat on the web, your own on phones

The same conversations reach the web, iOS and Android, on the same rooms. This is what each has.

On the web

The ready-made chat, who is online and who is typing, as elements for any page and as React components. Or the same events on a screen of your own, with helpers for React, Vue, Svelte and Angular.

On iOS and Android

Rooms, messages, typing, who is online and the history your route gives, in Swift and Kotlin, with ready-made call screens. There is no ready-made chat screen: your app draws its own, in its own design, on the same rooms.

In React Native and Flutter

Rooms, messages, typing and who is online on iOS and Android, on a chat screen your app draws.

On your server

Node.js, PHP and Python, with Laravel, Django, FastAPI and Flask, and the HTTP API for any other language: the rules, the webhook, messages from your server, and taking someone out of a conversation.

Use cases

What people build with chat

Each is a whole app in the docs, with its server in Node.js, PHP and Python.

Chat

Conversations between two people and in groups, with typing, read ticks and reactions, kept in your own database.

Marketplace chat

A buyer asks the seller about a listing, the seller online or last seen, and a notice or an email to whoever is away.

A support desk with agents

Each new conversation goes to an agent on duty, the others read along, and an agent calls the customer from the conversation.

AI chat, then a person

An assistant that answers in the conversation as your own model writes, and a person from support who takes over the same chat.

Who is online and who is here

A dot on every avatar, the people in a room with their roles, and how many look at a page.

Watch parties

A video that plays, pauses and jumps for everyone at once as the host does, with a chat beside it and a call of the party.

Pricing

Priced by connections, never by messages

From $11.99 a month for 1,000 concurrent connections, billed yearly, or $14.99 billed monthly.

Priced by concurrent connections, starting from 1,000, billed monthly or yearly. Messages and bandwidth are never charged, and what your server sends uses none of your connections.

The same plan and SDK bring video calls and live streaming, on the same connection.

Questions

Frequently asked

Do you store our messages?

No. A room keeps its last events for about five minutes, only so a page that reconnects misses nothing. Your server keeps the conversation in your own database, from the webhook or a route of its own, and the chat loads it from your route as it opens.

Do I need my own chat server?

No. Pages send messages to each other through our servers, with no request to yours, and everyone in the conversation gets them at once, on every tab and device. Your server says who may be in each conversation and keeps what it is sent.

Is there a ready-made chat?

Yes, on the web: a conversation with typing, read ticks, reactions, files and calls, as an element for any page and as a React component, beside lists of who is online. iOS and Android apps draw their own chat screen on the same rooms, with typing and who is online.

Which stacks can use the chat SDK?

Next.js and Express, Laravel and plain PHP, Django, FastAPI and Flask, Capacitor, iOS and Android, each with a guide. React Native and Flutter apps have rooms and presence too. A server in any other language uses the HTTP API.

Can you read our messages?

Not in a private conversation. Its messages, its history and who is in it travel sealed with keys your server makes, and the cloud carries them without being able to read them. Your server opens what its webhook brings, to keep it.

Who decides who may write to whom?

Your server, with a rule for each kind of conversation that reads your own data: who is in it, who may only read, and who is kept out. The cloud enforces every answer, and your server can take someone out of a conversation at once.

Can people send files and pictures?

Yes. The chat sends each file to a route of yours, which keeps it in your own storage, and the message carries only where it is, its name, type and size. The cloud never has the file.

Can I build my own chat screen?

Yes. The ready-made chat is optional. Change its colours and words, or draw the conversation yourself on the same events, so your screen and the ready-made chat talk with each other.

What does a chat cost?

Chat is priced by concurrent connections, starting from 1,000, billed monthly or yearly. Messages, typing, read ticks and files are never charged, and what your server sends uses none of your connections.

Questions about your integration? Write to us: we help with the SDKs, the call screen and your stack.