Stream status widget

This code suggests you are doing the call client side

Essentially for “dumb website status widgets” you can no longer do this in pure Javascript Client Side, as you need a token to call Helix with.

And you don’t want to be asking users to login each time they visit your website to see if you are live.

So now you are required to make the calls on the server/in server side scripting.

There you will either use EventSub or the API to get Streaming status, which is then stored/cached somwhere on your server, perhaps in a database.

Then, your frontend will display stream status based on the value in the database or cache, rather than a direct API call.

In this scenrario, both EvetnSub and the API calls would utilise an App Access/Client Credentials token

And here is the Get Streams Reference

And the link to EventSub, EventSub, currently, is a Web Hooks based service, so when Streams go live/go offline Twitch will tell you, so you don’t have to make any API calls at all