GameServerWeb.PlayLive
(game_server_web v1.0.935)
Copy Markdown
LiveView wrapper that embeds the Godot web export (/game/index.html)
inside the app layout so the navbar is visible.
The game itself runs in an iframe with its own COOP/COEP headers
(set by GameServerWeb.Plugs.GameHeaders) so SharedArrayBuffer works.
When the user is session-authenticated, this LiveView mints a short-lived JWT access-token (and a refresh-token) so the Godot game can call the API. Tokens are delivered in two ways:
- URL fragment – the iframe
srcbecomes/game/index.html#access_token=…&refresh_token=…(fragment never leaves the browser). - localStorage – a JS hook writes
gamend_access_tokenandgamend_refresh_tokenso the game can also read them withJavaScriptBridge.eval("localStorage.getItem('gamend_access_token')").