I was reading the documentation here Extensions | Twitch Developers and it mentions that the method Twitch.ext.onAuthorized will return a userId starting with U- in case the user is logged and with A- when it’s not.
However, when testing using the Twitch Developer Rig this is not the case. Is this some exception and when on production this will actually work?
Also, going from here, once I get the information that comes back from onAuthorized how do I go from here, to actually getting the viewer username and if possible the avatar.
Don’t use the opaqueID, the opaqueID is essentially a sessionID and shouldn’t really be used for operations (other than the Extension PubSub whisper topic or storing “game progress” before a user logs in to the extension, like level 1/2 is free then you need to login)
Take the ID from the correct place for the user you want to get username/avatar.
Then either call the API locally, if on a platform that has helixToken
Or pass the whole JWT to an EBS and the EBS calls the API with an App Access Token.