Skip to main content

Twitch Viewers

@reset/twitch-viewersv2026.10.23.1· MIT· 3d agoBEHAVIORSACCEPTED WARNINGS
01README

Record and summarise a game's live Twitch streams and viewers.

02Behaviors1
@reset/twitch-viewersv2026.10.23.1twitch_viewers.ts

Global Arguments

ArgumentTypeDescription
clientIdstringTwitch application client id, supplied with a vault.get expression, never a literal. Sent only to id.twitch.tv and api.twitch.tv
clientSecretstringTwitch application client secret, supplied with a vault.get expression, never a literal. Sent only to id.twitch.tv to get an app access token
gameId?stringTwitch game or category id, e.g. 33214; give this or gameName, not both
gameName?stringTwitch game or category name, matched exactly as Twitch spells it, e.g. Fortnite; give this or gameId, not both
fn sample(maxPages?: number, top?: number)
Read the game's live streams from Twitch's Helix API and record their count, viewers, top streams and languages as a new version
ArgumentTypeDescription
maxPages?numberMost pages of 100 streams to read, most watched first, 1 to 50; 10 when omitted
top?numberHow many of the most watched streams to record, 1 to 100; 10 when omitted
fn summarise(since?: string, top?: number)
Summarise the recorded samples: peak and average viewers and live streams, and the streams most often in the top lists
ArgumentTypeDescription
since?stringOnly summarise samples recorded at or after this ISO-8601 time; all samples when omitted
top?numberHow many of the most often listed streams to report, 1 to 100; 10 when omitted

Resources

streams(infinite)— One game's live Twitch streams at one moment: how many, their viewers, the top streams and the viewers per language
summary(infinite)— Peak and average viewers and live streams over the recorded samples, and the streams listed most often in the top lists
03Stats
B
86 / 100
Downloads
4
Archive size
22.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository0/2missing

05Platforms
06Labels