With the previous version of the API I used this code to put a warning on my site that I was online. Now I can’t figure out how to use the new version I haven’t found anything that gives me back online/offline. Help!!
So you would use server side code to generate an App Access Token.
And use that to perform lookups on the API
Alternatively if using server side you can eventsub and collect live status into a database, and Twitch will tell you when a stream starts or ends.
You cannot and should not generate an app access token in the front end as that would leak what is essentially a password, and I don’t think you want to use an implicit auth as you don’t want to be having random website visitors login to generate a token to use.
So in summary, you need some server side code.
Something like this would be suitable if you have access to PHP