five-on-it / apps/client/electron/steam
apps/client/electron/steam
Steam in the desktop app's main process, through steamworks.js (pinned to 0.4.0, imported only here and only when it is needed): with a Steam app id (FOI_STEAM_APP_ID, baked in when the app is built, a run's own environment overriding it, 0 for none) the app starts Steam's client API, asks a packaged build launched outside Steam to be started again by Steam (restartAppIfNecessary, then it quits), turns the overlay on, and hands the page a fresh ticket for the platform's API whenever it asks (GetAuthTicketForWebApi, the identity the API checks it for, TICKET_IDENTITY; in hex for POST /auth/steam). Without an app id, without the module (another platform, a build without it) or without Steam running, there is simply no ticket (startSteam never throws): the page offers Steam's own sign-in page in a window instead (steam-openid.ts), and Play local never needs Steam.
The end-to-end tests' seam: an unpackaged app given FOI_STEAM_FAKE_TICKET (one of the fake Steam's tickets, fake:<steamid64>:<own|shared|none>[:banned], which only an API with FOI_STEAM=fake accepts) hands that ticket out and never loads steamworks.js. It is the main process's environment: nothing the page does can set it.