¶
Realtime features you copy into your app. Notifications, chat, presence, AI agent streaming and voice, for Node, Python and Go servers, with React UI that works with any of them.
Build one in 15 minutes Browse the kits
Compose features, not plumbing¶
Each kit is one feature. Add as many as you need, list them on the same WebSocket route, and change any of them in place. Here, a chat room and its live roster:
// Tuned in place; swap its store the same way.
const Chat = roomChatTopic({ backlogLimit: 100 });
export const room = consumer('/ws/rooms/{room}', {
name: 'room',
authenticate,
topics: [Chat, PresenceTopic],
});
// From a worker, a webhook, anywhere:
await Chat.postToRoom(chanx, 'general', 'Deploy finished', { id: 'ci' });
# Tuned in place; swap its store the same way.
class ChatTopic(RoomChatTopic):
backlog_limit = 100
RoomMessage = ChatMessage | PresenceJoinMessage | PresenceLeaveMessage
class RoomConsumer(AsyncJsonWebsocketConsumer[RoomMessage]):
topics = [ChatTopic, PresenceTopic]
# From a worker, a signal, anywhere:
await ChatTopic.post_to_room("general", "Deploy finished", ChatAuthor(id="ci"))
// Tuned in place; swap its Store the same way.
var chat = roomchat.RoomChatTopic{BacklogLimit: 100}
func (RoomConsumer) Topics() []chanx.TopicHandler {
return []chanx.TopicHandler{chat, presence.PresenceTopic{}}
}
// From a worker, a handler, anywhere:
chat.PostToRoom(ctx, pub, "general", "Deploy finished", roomchat.ChatAuthor{ID: "ci"})
In the browser, the same for every server. Both hooks share one socket:
const { entries, status, send } = useChat(room, room.topics.roomChatTopic.with({ room: 'general' }), options);
const { members } = usePresence(room, room.topics.presenceTopic.with({ scope: 'general' }), options);
return <ChatRoom entries={entries} status={status} onSend={send} members={members} self={me} />;
Each topic keeps its own handlers and authorization, so either kit works without the
other, and the next feature (notifications, an AI agent) is one more line in topics.
What you can add¶
-
Push to a user's open tabs from a worker or another service.
Node · Python · Go
-
History replayed on join, then every message live.
Node · Python · Go
-
Who is in a room, document or tenant, as it changes.
Node · Python · Go
-
Any agent's events to the browser over AG-UI; cancel, share a run.
Node · Python · Go
-
A Pydantic AI agent over AG-UI, approvals included.
Python
-
Live captions, text to speech, a voice agent you can interrupt.
Node · Python · Go
-
Stores, providers and the rest, with the servers each runs on.
Why chanx-kit¶
-
Stop rebuilding the plumbing
Groups, per-subscriber authorization, state on connect, cleanup on disconnect, reaching a browser from a worker: written once, tested, on Express, Fastify, Hono, FastAPI, Django, net/http, gin, Echo and Fiber.
-
Own the code
One command copies readable source into your project. Edit it, delete half of it. No framework owns your connections.
-
Both ends always agree
The browser's types come from your server's schema, and every server language is checked against the same messages. Swap Node for Go and the UI does not notice.
How the pieces fit: how it works. Using an AI coding assistant? Point it
at llms.txt, or every page at once in llms-full.txt.
Built on chanx, chanx-go and chanx-js, one protocol across three languages, and copied in with copit. Pronounced "chan-X kit".