Skip to content

StreamArena SDK

View as Markdown

The StreamArena SDK lets you build a live stream game in one JavaScript file. You describe one round, and the runtime does the rest: chat from YouTube, Twitch, Kick and Rumble through Upstream.so, phone join by QR code, loose answer matching, timing by when an answer was sent, the house player, the scoreboard and the 16:9 overlay.

A game is one object passed to Playcade.game(). Its round() function runs once per round.

movie-barcode.js
Playcade.game({
id: 'movie-barcode',
title: 'Movie Barcode',
inputs: ['guess'],
content: FILMS,
async round({ item, show, chat, timer, reveal }) {
show.html(barcode(item)) // draw anything in the game area
chat.expect(item.title) // loose matching, faster answers score more
await timer(40, { 12: () => show.hint('Released ' + item.year) })
await reveal(item.title)
},
})
  • Reads chat from Upstream.so's Multi-chat and answers from phones, and hands both to your game in one shape.
  • Matches guesses loosely: case, accents, "the", filler words and small typos.
  • Times every answer from when the viewer saw the round, so a slow platform never loses.
  • Runs a house player when fewer than three people are playing.
  • Draws the header, the join code, the timer and the scoreboard around your game area.
  • Passes names and free text through the safety filter before they reach the screen.