I’ve been going through all the forums but i cannot find anything to help me: I’ve been doing some local and hosted test of my extension and I cannot get the user id in the JWT. When it’s the broadcaster who installs the test extension, I get the user id but when I use any other account (that I added in the test account list), I can only get the opaque ID. I also never get the popup to allow sharing of the user id, I only get the popup saying it’s an unapproved extension. Can you please help?
I forgot indeed to do it. I just did and it added an option to the bottom of my panel to share my account information:
Unfortunately when i try to check to content of onAuthorize; i still get the same opaque id. Maybe it’s different in the JWT? I could not check right away but I was under the assumption that onAuthorize should give the same results.
Thats expected, the opaqueID is essentially a session ID, so in the example of a game, you let a logged out player play level 1, then prompt to login (share their ID) to save their progress, as the opquaeID shouldn’t change during the login process.
The userID is encoded in the token itself
For an example, to extract the userID from a decoded JWT Token
Or for frontend usage
It’s considered bad practice to auto prompt, but you can do it
my example generates a “obvious” button for people to click
The function is window.Twitch.ext.actions.requestIdShare();
Thank You very much Barry, it will help me a lot. I don’t want to pop it right away indeed, I agree it’s not very user friendly but my current implementation uses twitch id in the backend and I haven’t figured out how to migrate to using opaque ID and then matching with the real id on my website when the user comes for other purposes.