The OpaqueID is what starts with U/A. Only the broadcasters will become the users ID except for Bug or Intender: OpaqueUserId is _not_ UuserID when the broadcaster + extension uses ID Linking · Issue #559 · twitchdev/issues · GitHub use case
The opaqueID is more like a “sessionID”
To get the users true userID you need to request userID sharing and then get the userID when the user has logged in/shared their ID to the extension
Not sure without being in front of your rig to check all your settings.
if it’s
- a rig issue,
- a user view setup issue
- a github 559 issue
After userID sharing:
Either use helixToken and call the API (not available in the rig or mobile) - No `helixToken` in the rig · Issue #471 · twitchdev/issues · GitHub or `helixToken` `undefined` in mobile apps · Issue #455 · twitchdev/issues · GitHub
Example: https://github.com/BarryCarlyon/twitch_extension_debug/blob/main/extension/panel/helix.js#L48
Or pass the JWT to an EBS - example: GitHub - BarryCarlyon/twitch_profile_extension: A simple Twitch Extension to cover the basics of using the JWT and EBS together to get Twitch API information
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)
ChannelID - is in onAuthorised - https://github.com/BarryCarlyon/twitch_extension_debug/blob/bec2c002cc930c9bfcb63c2dbc82e753eb54dcd1/extension/panel/script.js#L67
UserID - also in onAuthored but also in window.Twitch.ext.viewer.id is the viewer has authenticated/logged into the extension.
window.Twitch.ext.viewer.opaqueId - sessionID
window.Twitch.ext.viewer.id - logged in/id shared true userID
window.Twitch.ext.onAuthorized(auth => { channel_id = auth.channelId; } - channelId
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.