Turn-based matches
Asynchronous multiplayer (chess, words, card games) over HTTP, with no realtime connection needed.
For turn-based games, players don't need to be online at the same time. A match holds shared state and a turn order; each player submits their turn when it's their move. No persistent connection required.
const { match } = await tg.asyncMatch.create({ type: 'chess', opponents: ['p_9'] });
const mine = await tg.asyncMatch.mine(); Server-enforced turns + OCC
The server enforces turn order (not_your_turn out of turn) and optimistic concurrency (async_conflict on a stale version), so two devices can't both move. Read the match, submit with the version you saw.
await tg.asyncMatch.turn(match.id, { state: nextState, version: match.version, end: false });
await tg.asyncMatch.forfeit(match.id); - Social and teams
Friends, share/invite links, and teams (clans) with roles, invites, and requests.
- Realtime rooms
WebSocket rooms with presence, broadcast, in-transit chat moderation, private rooms, typing indicators, self-healing reconnect, and history.
- Leaderboards and competition
Boards, periods, keyed boards, tournaments, and promotion/relegation leagues.