Skip to main content

Chat (WebSocket)

Session bootstrap

GET /chat/token

  • Query: matchId=<uuid>

Response

{ "wsUrl": "wss://chat...", "wsToken": "<short-lived-token>" }

Message shapes

DirectionEventPayload
Client → Serverjoin{ "matchId": "<uuid>" }
Client → Servermsg{ "text": "Hey adventurer!" }
Client → Servertyping{ "isTyping": true }
Server → Clientsystem{ "event": "joined" }
Server → Clientmsg{ "id": "<uuid>", "from": "did:web:...", "text": "...", "ts": "2024-01-01T00:00:00Z" }
Server → Clientreveal{ "state": "pending", "by": "did:web:...", "media": { "url": "https://...", "kind": "clip" }? }

Gate enforcement lives server-side: links/media are rejected until both players reach Chapter ≥ 3.