Examples

Examples

Runnable projects live in examples/ (opens in a new tab) in the repository.

Live Room

A collaborative multiplayer room — live cursors, presence, flying reactions, and chat, over WebSockets, with no database. A Python agent joins the same room as the browsers, which is the point: a Konet channel is cross-runtime.

examples/live-room (opens in a new tab)

What you seeKonet feature
Other people's cursors moving liveBroadcast
"N online" counterPresence
Emojis flying across the screenBroadcast
Chat backlog when you join lateHistory replay (konet:history)
A 🤖 that moves, reacts and chatsCross-runtime channel (JS + Python SDK)
The Studio link in the top barStudio

Run it

You need a running server and an anon_key:

konet start
konet keys generate      # prints the anon_key, also visible in Studio → Keys
💡

History replay is off by default. Start the server with KONET_HISTORY_LIMIT=50 if you want late joiners to receive the chat backlog — everything else works without it.

The web app (Node 18+):

cd examples/live-room/web
npm install              # pulls the local SDK via file:../../../sdk/js
npm run dev

Open the printed URL (usually http://localhost:5173), paste your anon_key, and enter the room. Open a second tab to watch cursors and presence sync.

The Python agent (3.10+, optional but the fun part):

cd examples/live-room/agent
python -m venv .venv && source .venv/bin/activate
pip install -e ../../../sdk/python
KONET_TOKEN=<your anon_key> python agent.py

Two things it demonstrates

Identity travels in the payload, not in presence. Presence metadata is fixed server-side (online_at, room, role), so each client carries its own name/color/id inside broadcast payloads.

Phoenix delivers a broadcast back to its sender. JSON broadcasts are echoed, so a client filters out its own messages by id. Binary frames are the exception — they are never echoed, see Binary Frames.

Push-to-talk

Binary frames and floor control have no standalone example yet. The protocol page carries working snippets for all four SDKs: Binary Frames & Floor Control.