Skip to content
folkways

Chat and in-app messaging

Folkways Chat

Messages on a stream, read receipts as KV values and typing as signals, with sending status in the UI.

StreamKVSignal

rooms/release-teamstream · kv · signal

4 here
MI

Mia

Release notes are up for review.

JO

Jonas

Reading now. The migration section is great.

Shipping at 3pm then 🚀

Delivered

one topic: message is Stream · read is KV · typing is Signal, gone after 5 s
One room, one topic: messages are Stream events, each reader’s last-read position is a KV event for receipts, and typing is a short-lived signal.

Features

What Chat does.

Live works today·Coming soon on the roadmap

  • Live

    Rooms with history

    People who open a room load recent messages, then get every new one in order.

  • Live

    Sending status and retry

    Each message shows as sending, then sent, or failed with a retry.

  • Live

    Read receipts

    Each reader’s last-read position, kept as a KV value.

  • Live

    Typing indicators

    Short-lived signals that fade on their own.

  • Live

    Instant load from cache

    With local storage, recent messages render before the connection is back.

  • Live

    Per-room access

    Your backend decides who can read or post in each room.

  • Live

    Works with React, Svelte and Vue

    Live message lists and typing with useSyncExternalStore, stores or refs.

  • Live

    Direct messages and group rooms

    Your backend opens a room for two to 50 people, and each one gets an invite on their personal topic.

  • Live

    Instant access revocation

    Your backend disconnects a user, or cancels one token, instead of waiting for it to expire.

  • Live

    One topic per room

    Messages, read receipts and typing on one topic, with one permission and one subscription.

  • Live

    Member lists for private rooms

    Your backend decides who can join. Removing someone cuts them off at once.

How it’s built

The topics.

One topic can carry several delivery types: each event name has its own, set once in the topic rule.

rooms/{room}Keep presence on3 types, one topic

The whole room on one topic: one permission, one subscription. Turn on Keep presence to see who is in it.

Events on rooms/{room}
EventType
messageMessages, in order, with history for people who open the room later.Stream
readEach reader’s last-read message. Keyed by the publisher, so nobody can write another user’s receipt.KV
typingWho is typing right now. Each signal lasts five seconds.Signal
$user/{identity}kept by Folkways

Each signed-in user’s personal topic, kept by Folkways. Invites to new direct and group rooms arrive here.

Events on $user/{identity}
EventType
inviteA new room to join, sent by your backend.Stream

Details

Good for

  • Group chat and community rooms
  • Customer support chat
  • AI assistants
  • Team collaboration

Good to know

  • A room is one topic: give its rule the Stream, KV and Signal types and name each event’s type. Only Stream events get cursors, so history has no gaps.
  • A private room’s rule is set to Members only. Your backend adds and removes members, and can also kick someone or revoke a token at once.