So I want to connect to PubSub so I can track when people spend Channel Points in my streams (and I guess some other stuff provided by Pubsub) but the documentation for the process is woefully incomplete with regard to OAuth or what constitutes a “Client ID”.
Now, I know I can get a client ID by creating a Twitch App, but how does that relate to this? A Twitch App is in no way related to my personal twitch account or my streams, and doesnt seem to work with PubSub at all. Also, when subscribing to PubSub subscriptions, I need to supply a channel ID but there’s no actual explanation of how to get your channel ID (or user ID or anything to that effect). Is Channel ID static? Can I just pull it from somewhere?
Edit:
Just to add, when I send get requests to https://api.twitch.tv/kraken/channel I just get replies with jokes about v3 being depreciated and to use api v5 instead, despite this being what I’m apparently supposed to do to use the v5 API according to the documentation.
First you sign up for a Client ID, which then also gives you a client secret.
Then you need to get the users permission to talk to the API on their behalf
The PubSub topics describe the kind of oAuth token and the scopes needed, In this case it’s a user token (not a server to server/client credentials token)
Authentication is covered here
You generate a URL, with the scopes needed on it,
User is sent to that URL,
User accepts (or declines) your applications (IE ClientID’s) access to their account
They come back to your webpage and you do the last bit of the oAuth dance*
if needed depending on if you are using “regular” oAuth or implicit
This example uses implicit auth, so it’s just a “dumb get started” example and normally not something you’d use in production as implicit oAuth tokens cannot be renewed, when the token dies the user has to manually go throw the whole oAuth flow again
Once you have a token, you can call the users endpoint
Omitting any id and login, and just specifying the oAuth token and the API will return the user for that token, then you have the ID and username for the authenticating user
In the end I used the new API instead, which is equally nightmarish but seems to work so you’re welcome to close this. It’s kinda crazy how there’s a 3 stage process of creating an app, using an API to get a token and find out your channel ID and then using this PubSub thing to get points redemptions instead of just being able to see them in the IRC server like all the others humans in the chat can freely do with their human eyeballs, but it’s working now so you’re welcome to close this.
edit: also amazing that preset Channel Points redemptions appear in IRC and Not in PubSub but custom redemptions appear in PubSub but not in IRC lol
Not all points redemptions are sent over IRC as chat only those that have a chat message component as part of the purchase do.
Additionally various messages in chat are sent via PubSub and IRC and collated together in the chat feed
Pretty standard regardless of what platform you are working on.
Create an App,
Authenticate that apps access to your account
Go wild with the Access Token
Only Redemptions that raise a chat message are sent via IRC.
So “Highlight a message”/“send a message in sub only mode” will go out over IRC but not via the PubSub Topic.
Hopefully Twitch will give us a singular feed at some point but currently the Channel Points topic, is just for “A custom reward is redeemed in a channel.”, or at least access to all the redemptions that occur
So right now we get nothing at all when someone redeems an emote or emote modification.