flai
July 12, 2018, 6:25pm
1
Hi everyone,
how do I get the name (or preferably the ID) of the channel that my extension is embedded in?
At the moment I do the following:
window.Twitch.ext.onAuthorized((auth) => {
log('Live on channel', auth.channelId);
window.TwitchChannelId = auth.channelId;
main();
});
However, I’m not confident that this will work for non-logged-in users. Is this the recommended way, or is there a better way?
Thank you for your help!
Not sure it works? Test it!
ChannelID is always returned in the auth callback
flai
July 13, 2018, 1:34pm
3
Thank you, I have tested it.
Does this also work for non-logged-in users? I have no way to test that before the extension is approved.
Good point. Hand’t had coffee yet
You can test a logged out view with the developer rig
https://github.com/twitchdev/developer-rig
The only difference between logged out, logged in not authed, logged in auth, is if a UserID is returned and what kind of opaqueID you get.
The channelID is always returned.
1 Like
flai
July 13, 2018, 3:46pm
5
Thanks you for your help!
I don’t have the dev-rig set up for the extension I’m developing, as I’m integrating heavily with the video on stream, so I didn’t even know that was a feature.