Skip to content
Extending Kemble

The realtime connection

One WebSocket, what it carries, and what it deliberately does not.

Connect to /api/ws with your bearer token. The socket carries messages, typing, presence and voice state for everything you can see, on one connection — a client does not open a socket per channel.

Presence is reference-counted per account, so a second device does not mark you offline when it disconnects. Typing and voice state are ephemeral and are never persisted.

Send the auth frame the moment the socket opens: a socket that has said nothing for five seconds is closed with 4401. Each open socket holds a connection on our side, so one address may hold 32 sockets that have not signed in yet, and one account 48 signed in at once, every device together; past either the socket is closed with 4429 — wait a few seconds before connecting again.

The socket is a delivery mechanism, not a second API. Everything it announces can also be fetched over REST, which is what makes a reconnect a refetch rather than a resync protocol.