Proper way to perform a helix API call Using JavaScript

Hey thanks for the information. That fetch call looks pretty similar to what I concocted, but I think I was missing the “.then” statements.

As for the API call info, this is a ‘distributed app’ so to speak. The base app/script is already available and in use by people, I’m just looking to add some functionality to it. Every person using this is doing so self hosted, either as a windows/Linux app or via Docker. As such, there is no way to have a centralized dB or cache system that would work in that way.

Essentially, the base script was checking the front page of a specific game, and recommended a random live stream that had a specific tag. What I want to do is check if a preferred streamer (user set) is online and recommend them over a random. Each instance of the script would at most run a api call twice every minute, but I have no way to know how many Instanced exist.