← Back to examples

Get started

  1. Install dependencies with npm install.
  2. Export TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET (or add them to .env).
  3. Run npx tsx examples/FETCH_STREAMS.ts to request the first page of live streams from the Helix API.
  4. Review the console output for the raw API payload or any authentication troubleshooting tips.

What you can do

  • Swap the first query parameter to page through more results.
  • Add filters like game_id or user_login for targeted lookups.
  • Reuse the authenticated HelixClient instance for subsequent API calls in your app.
  • Hook the data into analytics, overlays, or moderation workflows.

Extend it further

  • Combine with the authorization code example to act on behalf of a broadcaster.
  • Cache stream responses using your preferred store to avoid rate-limit pressure.
  • Trigger EventSub subscriptions for channels returned by the query.