Inspiration

Twitch chat usually comments on a stream. Raid Relay gives viewers a shared goal: become the crew of a cooperative space expedition.

What it does

The streamer launches a six-sector mission from a control desk. Viewers vote with !scan, !shield, or !boost. Each viewer has one vote per round; sending a different valid command replaces that vote. When the timer ends, the winning action resolves the encounter and changes the ship's hull, shields, energy, and score.

A separate overlay window displays the mission and votes on stream. The desk and overlay share state in the same browser profile, and OBS captures the overlay with Window Capture.

A clearly labeled demo mode uses simulated chat so the game can be explored before connecting a Twitch channel.

How I built it

I built Raid Relay with OpenAI Codex, React, TypeScript, and Vite. Codex helped implement the mission rules, voting, control desk, overlay, read-only Twitch EventSub connection, automated tests, and setup instructions.

The Twitch integration uses the browser OAuth flow and EventSub WebSockets to receive channel.chat.message events with the user:read:chat permission. Raid Relay reads chat and does not post messages. The app does not call the OpenAI API at runtime.

Principal build session recorded in the existing entry: 01a178a5-43fe-7d52-8b06-c76edf93b3b3.

Validation

All 17 automated tests pass, and the TypeScript check and Vite production build pass. Tests cover vote replacement, round deadlines, pause behavior, mission outcomes, token validation, chat deduplication, and reconnect behavior.

Local browser checks confirmed that demo votes arrive, an encounter resolves with updated resources and score, and the overlay follows the control desk.

Challenges and current limitations

Access tokens stay in application memory. Twitch must be authorized by a user with the required chat scope before a live mission can be tested.

OBS Browser Source uses a separate browser context and does not receive the desk's updates. The overlay requires Window Capture and the same browser profile as the desk.

Real Twitch verification and recording of the original Codex build session remain pending. The current narrated video is a screenshot preview with simulated chat; it is not evidence of a live Twitch demonstration.

How to run

Use Node.js 22.12 or newer:

npm install
npm test
npm run build
npm run dev

Connect Twitch from the control desk with your channel and Twitch application client ID. Add the exact redirect URL shown in the connection panel to the Twitch app, authorize user:read:chat, connect the crew, and launch a mission. Never enter a client secret in the app.

For a first look, launch a demo mission and use the voting cards. Open Stream overlay in the same browser profile to inspect the synchronized view.

Built With

Share this project:

Updates