Discover Game Center Realtime Broadcast
Changed onPublic. Returns Supabase URL, anon key (also as token), and the private channel template events:{gameId}. Socket auth is Supabase-native: ?apikey=<anonKey> on the socket URL (native and web) or the x-api-key header (native); a user JWT goes in phx_join.access_token (prefer @supabase/supabase-js, which sends both correctly). Envelope: every game/plays/stats broadcast carries seq (= publish-time ms, ordering-only per game+event); stale/duplicate seq <= lastSeq is ignored. Broadcasts are full snapshots/replacements, so resync via REST only on (re)join, phx_error, or unexpected phx_close — never on a jump. Live types score/clock/period/goal/penalty/status are observed by diffing game snapshots + plays kinds. Resync: snapshot GET /api/events/{gameId}, replay GET /api/events/{gameId}/plays?afterId={lastPlayId}. Polling/ETag stays the fallback. Only the API service role may broadcast.
Request
- Base URLhttps://app.d-sports.org
- Authnone required
Response
{ success, data: { enabled, url, anonKey, token, channelPrefix, channelForGame, private, events, liveTypes, auth, resync, note } }
Changes
- info
endpoint added
- info