Subscribe to lobby events (SSE)
Lobbies
Subscribe to lobby events (SSE)
Opens a Server-Sent Events (SSE) stream for real-time lobby updates. The caller is identified by x-player-id.
Event types:
| Event | Description | Frequency |
|---|---|---|
connected | Initial event with full lobby state | Once on connect |
lobby_updated | Lobby state changed (player joined/left, settings changed, game started, etc.) | On every change |
lobby_deleted | Lobby was deleted (all players left or timeout) | Once, then stream closes |
queue_stats | Live matchmaking queue statistics | Every 10s while in_queue |
ping | Keep-alive heartbeat | Every 30s |
Usage (JavaScript):
const es = new EventSource('/api/v3/lobbies/casual/me/events', {
headers: { 'api-key': 'pf_...', 'x-player-id': 'player123' }
});
es.addEventListener('lobby_updated', (e) => {
const lobby = JSON.parse(e.data);
updateUI(lobby);
});
Connection lifecycle: The stream stays open until the client disconnects, the lobby is deleted, or the player is kicked. Reconnect automatically on disconnect.
GET
Subscribe to lobby events (SSE)
Documentation Index
Fetch the complete documentation index at: https://docs.playflowcloud.com/llms.txt
Use this file to discover all available pages before exploring further.