Skip to content

Protocol (advanced) ​

Most apps should use @omnychat/client and skip this page. Read on only if you are building a custom client.

OmnyChat speaks Protobuf over WebSocket binary frames. One WebSocket message = one Envelope.

Schema: proto/omnychat/v1/omnychat.proto

Framing ​

  • Binary WebSocket frames only (not text/JSON)
  • Max size defaults to 1 MiB (OMNYCHAT_MAX_FRAME_BYTES)
  • Server sends WebSocket pings; reply with pong

Common payloads ​

DirectionTypePurpose
Client → serverAuthJWT on first frame
Server → clientAuthOKAuthenticated; includes user_id
Client → serverJoinRoom / LeaveRoomSubscribe to a room
Client → serverSendMessageroom_id, client_msg_id, body
Client → serverEditMessage / DeleteMessageAuthor-only
Server → clientMessageAck / MessageEventConfirm + fan-out
Client → serverTyping / ReadReceipt / SyncRoomPresence + catch-up
Server → clientErrorcode + message

Happy path ​

  1. Connect → Auth → AuthOK
  2. JoinRoom → JoinOK
  3. SendMessage → MessageAck (+ MessageEvent to the room)

REST bootstrap ​

POST /v1/rooms
Authorization: Bearer <JWT>
{"id":"lobby","name":"Lobby"}

Same JWT keys as WebSocket auth. App integration: Getting started.

Apache License 2.0