Inspiration

Twitch streamers often ask chat to decide things ("which game next?"), but built-in polls are separate from chat and hard to show on stream. ChatPoll lets viewers vote the way they already chat: by typing 1, !1 or !vote 2.

What it does

  • Viewers vote in real Twitch chat (one vote per viewer).
  • Results appear live on a transparent OBS Browser Source overlay with animated bars, a vote flash and a top-voters leaderboard.
  • When the streamer closes the poll, the overlay shows a winner card with confetti and an optional sound (?sound=1).
  • A control panel lets the streamer connect a channel, start and close polls, and see poll history.
  • Twitch EventSub (WebSocket): channel point redemptions, subscriptions and gift subs can add bonus votes to a poll.

How it is built

  • Node.js + Express + ws. The server reads Twitch chat anonymously over IRC (read-only, no login), counts votes and pushes live state to the overlay over WebSocket.
  • eventsub.js is a Twitch EventSub WebSocket client: subscriptions on session_welcome, keepalive watchdog, session_reconnect handoff, backoff reconnect and de-duplication by message id.
  • Control panel is protected with a control token. Poll history and the leaderboard are saved to data.json.

How Codex was used (honest account)

The base prototype (basic chat voting, control panel, overlay, token auth, rate limiting, validation, IRC reconnect) was created before the Codex work, with another AI tool. I did not use Codex for that part.

Everything below was done in one Codex CLI thread ("Assess ChatPoll and plan EventSub", Codex CLI running in a GitHub Codespace), and all of it is pushed to the repo:

  • Read the repo, found that npm test failed on Node 24, and fixed the test setup (commit 2d7ab85).
  • Planned and built the Twitch EventSub WebSocket client, applied bonus votes to live polls, and added fake-WebSocket tests (commits cd77337, 400c10f). Test suite: 8 of 8 passing.
  • Wrote the Twitch app and EventSub setup docs in the README (commit 8ec59c8).
  • Polished the overlay: smooth animated bars, vote flash, winner card, canvas confetti, WebAudio sound, URL options (commit 711ada1).
  • Fixed "1 vote" / "votes" grammar in the overlay (commit 045bef9). Codex Session ID is provided in the submission form.

Challenges

  • Codex Cloud and Termux were not usable on my setup (Android phone only, no paid plan), so I ran Codex CLI inside GitHub Codespaces from my phone browser.
  • My Twitch channel is not an Affiliate, so I could not trigger real channel point redemptions or subscriptions. The EventSub part is verified with automated tests using mock events, not with live Twitch events. Live chat voting works with a real channel and is shown in the demo.

What's next

  • Test EventSub bonus votes on a real Affiliate channel.
  • Permanent hosting (right now it runs in

Built With

Share this project:

Updates

Submission history