Hi,
When I open the configuration page to enter some info I would like to use in my extension I realise that I don’t know how to get the information of the broadcaster that is configurating it, so even if I post the information to my EBS I dont have a way to link it to the streamer who activated the extension.
The docs don’t provide much info in this regard, so could someone be so kind of explaining how to do this step? Is there any way to get either the JWT or the channeLid / userId in Configuration UI to send it to the EBS? I’d like to know the same for Live Configuration too if they are different.
Thank you very much!
The config panel can use the same as viewer.html
window.Twitch.ext.onAuthorized(function(auth) {
var parts = auth.token.split('.');
var payload = JSON.parse(window.atob(parts[1]));
var channel_id = payload.channel_id;
});
Either process the auth or pass it in whole to your EBS when submitting a config form.
2 Likes
Ooh I get it. I thought onAuthorized was only fired when the user installed the Extension to store his credentials.
Tym this is all I needed!
onAuthorized fires EVERY page load, both for config and viewer…
Whether the viewing user has granted TwitchID access or not.
(the Payload will have a TwitchID if Granted, which is auto granted for the broadcaster)
1 Like