Stream
An ordered log with replay. Clients that fall behind can recover missed events in order while those events remain retained.
- chat messages
- AI token streams
- feeds
- orders
Built from three blocks
StreamKVSignal
The real-time infrastructure behind connected applications. Stream events, synchronize state and deliver live updates across web, mobile, AI agents, devices and backend services.
Automatic reconnection · Replay of retained Stream events
Simulated in your browser to show how cursor resume works. Amber marks events held in the stream while a device was away.
Building blocks
Every event has a delivery type: an ordered log, the latest value, or a short-lived signal. One topic can carry all three, so a whole chat room is a single topic.
An ordered log with replay. Clients that fall behind can recover missed events in order while those events remain retained.
The latest value for each key. Someone who joins late sees current values without paging through history.
Short-lived events for whoever is connected right now. Each sender’s latest signal lasts five seconds.
Implementation
Sign a token on your server, connect from your app, publish. The SDK handles reconnects, ordering, resume and fallbacks for you.
npm install @folkwaysio/realtimeimport { Folkways } from '@folkwaysio/realtime/server';
const rte = new Folkways.Rest({ segment, signingKey });
const { token } = await rte.createToken({
identity: `user:${user.id}`,
capabilities: [
{ topics: 'chat/>', ops: ['subscribe', 'publish'] },
],
});import { Folkways } from '@folkwaysio/realtime';
const client = await Folkways.connect({
authUrl: '/api/realtime-token', // your endpoint from step 2
});
const room = client.topic('chat/lobby');
room.subscribe((msg) => render(msg.data)); // resumes on reconnect
await room.publish('message', { text: 'Hi' });Why Folkways
Real-time looks simple until you need ordering, resume, presence and access control on unreliable networks. That’s the part we run for you.
| Area | Building it yourself | Folkways |
|---|---|---|
| Infrastructure | Socket servers, a message store, a pub/sub layer, scaling and failover | Fully hosted. Nothing to run |
| Ordering and replay | Build sequencing and a history store | Ordered log with replay, built in |
| Reconnects and reloads | Write resume logic for every client | The SDK resumes from the last cursor |
| Presence and online status | Track connections across servers | Turn it on per topic rule |
| Access control | Auth checks on every channel | Scoped tokens, private rooms, instant revocation |
| Unreliable networks | Handle blocked WebSockets and offline writes | HTTP fallback and an offline publish queue |
| Visibility | Wire up your own metrics | Dashboard with built-in analytics |
Security
Folkways delivers your payloads without needing to read them. Encrypt on the sender’s device, decrypt on the receiver’s, and only your users ever see the message.
Encrypt payloads before you publish, with Web Crypto, libsodium or the library you already trust.
When you encrypt first, your keys never reach Folkways. We relay and store ciphertext we can’t read.
The SDK supports optional encryption of locally persisted payloads using your own encryption implementation.
Every connection runs over TLS, on WebSocket and HTTP alike.
Sender’s device
key · 7f3aHi, the contract is signed.
Encrypted before it leaves the device
ciphertext · over TLS
Folkways
no keyciphertext · over TLS
Receiver’s device
key · 7f3aHi, the contract is signed.
Decrypted with the same key
Platform
Folkways is organised in three levels, and you manage all of them from the dashboard.
Your organisation: members, roles, plan and billing.
acme
One real-time app, isolated from the rest. Use one per app or environment.
chat-production · chat-staging
Where events flow. One topic can carry Stream, KV and Signal events; topic rules set the types, event names, who can do what, and limits.
rooms/{room}: message · read · typing



Products
Each product is a pattern for a common job, built from Stream, KV and Signal. Use one, or mix them.
Folkways Stream is an ordered event messaging service. Publish to a topic, replay retained history and resume from a cursor when the connection returns.
StreamChat and in-app messagingFolkways Chat combines ordered messages, read receipts as shared state and typing as short-lived signals on a room topic.
StreamKVSignalIn-app notificationsFolkways Notifications delivers in-app notifications to private user topics, with replay of retained messages when an app reconnects.
StreamSee who’s onlineFolkways Presence helps applications show who is online or in a room, alongside typing indicators and live cursors.
SignalPresenceLive locationFolkways LocSync shares current courier or vehicle locations as expiring key-value state, with trip events on an ordered stream.
KVStreamEvents between your servicesFolkways MicroSync connects backend services through HTTP publishing and ordered event subscriptions that can resume from a cursor.
StreamUse cases
AI streaming, live dashboards and multiplayer are where most teams start. The same three blocks power chat, notifications, live location, auctions, IoT telemetry and service events.
Stream model output through an independent backend job, with retained response chunks available after reconnects and reloads.
Push metrics, prices and statuses to every open screen. Late joiners see current values at once, with no polling.
Live cursors, presence and shared state for whiteboards, editors and games, without running socket servers.
Design partner program
We work closely with a small group of teams shipping real-time products: free usage while you build and launch, features made for your use case, and the engineers on call.
Up to 12 months
of free usage, sized to your app
Bespoke features
built around your use case
Direct line
to the engineers who build Folkways
Early access
and a say in the roadmap