Show Iframe when live and message when off line

  1. On your backend/cron job generate an App Access/Client Creds token
  2. Call Get Streams
  3. Store the Result in a db/cache/something

or

  1. Create an EventSub handler/listener
  2. On your backend/cron job generate an App Access/Client Creds token
  3. Subscribe to Stream Online/Offline
  4. When your Stream State changes, Twitch will tell you via a HTTP Post Store the Result in a db/cache/something

THEN

Your Front End will use the valud from your db/cache/something to decide if to show the iFrame or a message instead.

This will also give you access to the Stream Title and Game

With EventSub you would use channel.update, with Long Polling the API yoru Cron Job would grab it from it’s Get Streams Check