Opaque_user_id to user id

can any one help me to get user id from opaque_user_id

when i call auth.userID I got this: UpEDi9SZtuRV6B1Qk57tn
but my user id is : 3784759306677
so i need this id from my extensions.

You need to enable request ID Sharing.
Then ask the user to login/share their ID with your extension.

Then you will have access to the users Twitch ID via the helper (in window.Twitch.ext.viewer.id:) and the JWT.

Parsed JWT example:

The opaqueUserID is more like a sessionID it does not represent a user. So you cannot convert an opaque to a real. Further reading on opaqueID’s - Extensions | Twitch Developers and Required Technical Background | Twitch Developers

Full Example project: 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

how cann i enable request ID Sharing.

can you please send me example.

It’s in the developer console

  • Twitch Developers
  • Manage an extension
  • Manage a version of the extension
  • Go to capabilities
  • Enabled Request Identity Link

Uploading: Screenshot 2022-12-02 232440.png…

Enabled but …

Enabled but …

Did you click [share] and hit “yes” on the dialog that pops up?

If you are testing this as the broadcaster the button won’t work as the broadcaster is force opted in.

After enabling this option in the dashboard, you may need to uninstall and reinstall the extension to the test channel.

thank for help me bro​:heart::heart::heart::heart::heart::heart::heart::heart::heart::two_hearts::two_hearts::two_hearts::two_hearts::two_hearts:

2 posts were split to a new topic: Twitch API in an extension

A post was merged into an existing topic: Twitch API in an extension