Connecting to the API and getting data from Channel Points Rewards

This tells you the

  • HTTP Method, it’s GET
  • the URL to call https://api.twitch.tv/helix/search/channels?query=a_seagull
  • you need two headers, a client-ID header and and Authorization

(--location --request and superflous, and some of the newer docs, the doc writer has been using the “longer” form of the cURL flags/arguments)

This is then translatable into any langauge, Streamlabs does 5, well what about the others, such as PHP or brainfuck or lua for example?

Aside from being opinated on the languages, SL also is opnatiated on the libraries to use, like nodeJS they suggest you use node-fetch

Which means you learn to use node-fetch instead. As then we’ll get questions like “I’m trying to do this in axios/got/other module/no module at all”. So cURL is given as a cURL call can be translated to match whatever language you are working in and whatever module/library you are working with.

Which is why cURL is the first example in the Streamlabs docs, as cURL is universal

Given that all of Twitch’s offerings (except kraken) requires an oAuth token to do anything, you can’t just copy paste without getting a token first, so you can’t really do “simple” copy/pasta examples

cURL is “standard” and language agnostic.

Most lanaguaages generally just implement cURL under the hood and provide helper libraries to convert to cURL. So the Twitch docs are unopinated on langauge.

Not really thats, “heres how to use nodeJS library of socket IO to connect” it’s an “opinated” piece of documetnation that says “you should be using nodeJS”.

It’s four steps of “heres socket.io just use that”, (granted they are using a socket.io server). So the ways to connect to socket.io are limited, to the langauges that socket.io has been ported to. Twitch uses websockets (which socket.io uses underneath), and websockets can be made to work much more easily in any langauge, and thus the docs don’t give an opinion on language or modules to use.

Twitch’s docs tell you the endpoints you can call and the responses to those endpoints, so it doesn’t say use socket.io as thats an opinion on what you should use, as apposed to “heres the calls, use what you are used to using”

The only stupid question is the one you don’t ask.

Of course this is all irrelevant if instead of reading the docs, you use someone elses Twitch library (for nodeJS if you stay in node), as then you follow their docs for their library instead.

Feel free to use any module that can recieve HTTP Posts requests, I use express myself, so use what you are comfortable with, and you don’t have to use NodeJS.

For channel points first you need an access token (with the relevant scopes attached) to a channel that has channel points enabled, which is affiliate+