---
title: "Discover Game Center Realtime Broadcast"
method: GET
path: "/api/events/realtime"
tags: ["Events"]
---

# Discover Game Center Realtime Broadcast

`GET /api/events/realtime`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/events/realtime`
- Auth: none required

Public. 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.

## Response `200`

{ success, data: { enabled, url, anonKey, token, channelPrefix, channelForGame, private, events, liveTypes, auth, resync, note } }

## Changes

- **2026-08-26** `59a3c711262f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/events/realtime/get.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
