Replication API
The Replication API is Crowded Kingdoms' authoritative spatial replication
surface over UDP (User Datagram Protocol). Game clients that can open raw UDP
sockets authenticate via the Management API, mint an
app-scoped token for the app they are entering (mintAppToken — see
Portals & app-scoped tokens), call
serverWithLeastClients on the Game API for Buddy
assignment, then exchange replication messages directly with a Buddy server.
Buddy authenticates only app-scoped tokens; the identity session token that
login returns is rejected for gameplay.
Buddy is the name of the replication server program—not a separate product. When platform docs mention Buddy, they mean an instance of that program running in your environment. The wire protocol, handshake, and operational guides in this section describe how to speak to Buddy over UDP.
This section documents native UDP integrations—handshake timing, wire payloads, sequencing, HMAC, and failure modes. If you'd rather not implement the wire protocol by hand, the official CrowdyCPP SDK implements it natively in portable C++.
Clients that cannot open raw UDP sockets (typical browsers) route spatial traffic through the Game API's GraphQL mutations and WebSocket subscriptions instead—see the GraphQL UDP proxy guide.
Both paths share the same Management API identity (register / login) and the
same app-scoped token minted from it (mintAppToken or the browser portal
flow); only the transport differs (UDP to Buddy vs. GraphQL through the proxy).
Quick start
- Getting started — prerequisites and endpoints
- Authenticate and assign — login,
mintAppToken,serverWithLeastClients, session-ready wait - Send and receive — first spatial message and notifications
- Wire formats and HMAC — binary layout reference
- Operations — heartbeats, errors, reassignment
- Troubleshooting — "sends succeed but nothing comes back" and other connectivity issues
- Load testing — simulate real player traffic against your app with the open-source cks-loadtest tool