Networking¶
HyperToken synchronizes Automerge CRDT documents. The network layer carries CRDT sync blobs rather than game commands in peer mode; game logic remains in the Engine and Chronicle.
There are two distinct deployment models:
| Model | State owner | Typical transport |
|---|---|---|
| Relay-assisted peer sync | Every peer keeps a CRDT replica | WebSocket relay, optionally upgraded to WebRTC |
| Authoritative server | A server Engine owns the room state | WebSocket command protocol |
Choose peer sync when replicas should continue local work and merge later. Choose an authoritative room when one server should serialize dispatches and project state to clients. Neither model, by itself, is a claim of cheat prevention; application trust and validation remain product responsibilities.
The supplied relay is intentionally unauthenticated. For production use, protect the deployment with authenticated infrastructure and authenticated TURN credentials where WebRTC is used. See the topic pages for transport and failure details.