01 / 08
One stream, server-sent
A single long-lived HTTP response carries every update, so nothing special has to sit in front of it. The browser notices a dropped network and reconnects on its own.
One connection, and the rules you already wrote deciding what goes down it
01 / 08
A single long-lived HTTP response carries every update, so nothing special has to sit in front of it. The browser notices a dropped network and reconnects on its own.
Open one stream and records reach the browser as they change — created, updated, deleted — with no polling loop and no timer deciding how stale a page is allowed to get. A subscription is a collection, or a single record inside it, and the access rule already guarding that collection decides what any given subscriber is allowed to receive.
// Watch a collection
const stop = await base
.collection('messages')
.subscribe('*', (e) => {
console.log(e.action, e.record.id);
render(e.record);
});
// create | update | delete
Hanzo Realtime powers a wide range of applications that demand immediate data updates
Popular Use Cases
Build messaging apps with real-time delivery, typing indicators, and read receipts.
Create shared workspaces where multiple users can collaborate simultaneously.
Several people editing one document, each of them seeing the others' changes land as they happen.
Develop low-latency multiplayer games with synchronized game state across players.
Build dashboards that update in real-time as new data becomes available.
Create collaborative coding environments with real-time changes and execution.
Mint a grant, spend it to open the stream, say what you want to hear about
One authenticated request returns a string good for thirty seconds and exactly one stream
Spend the grant, take the client id it hands back, then post the collections and records you care about
Any create, update or delete reaches everyone watching whose rule lets them see it
There is no hidden protocol here. A grant is minted on a normal authenticated request, the stream spends it once, and the client id that comes back is how you tell the server which collections and records you want. The SDK does all three for you; the raw calls are there if you would rather do it yourself.
// 1. mint a grant on an ordinary authenticated request
const { token } = await post('/v1/realtime/token');
// 2. spend it — once, and within thirty seconds
const es = new EventSource('/v1/realtime?token=' + token);
es.addEventListener('CONNECT', (ev) => {
const { clientId } = JSON.parse(ev.data);
// 3. name the collections and records you want
post('/v1/realtime', {
clientId,
subscriptions: [
'messages', // the whole collection
'orders/ord_42', // one record
],
});
});
// records arrive as events named for the topic
es.addEventListener('messages', (ev) => {
const { action, record } = JSON.parse(ev.data);
if (action === 'delete') remove(record.id);
else render(record);
});
// a grant is spent; a dropped stream reopens with a new one
es.onerror = () => reconnect();
The parts that scale, and the parts that are simply not in the way
A record is written once and handed to the subscribers already attached to it. The work is the number of people watching, not the size of the collection they are watching.
Not a process, not a socket server beside the API — an HTTP response left open. They are cheap to hold, and one that goes away releases what it held without anything needing to be told.
Every org's subscribers sit on that org's own broker, over that org's own data. Adding a tenant adds a broker rather than widening a shared one, so nobody's growth is anybody else's problem.
Mint a grant, open the stream, name a collection. No credit card to start.