- On your backend/cron job generate an App Access/Client Creds token
- Call Get Streams
- Store the Result in a db/cache/something
or
- Create an EventSub handler/listener
- On your backend/cron job generate an App Access/Client Creds token
- Subscribe to Stream Online/Offline
- 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