“Once the extension is listening, the EBS or broadcaster can send an individualized message to the channel.”
I understand that the broadcaster could use send() through the extensions JavaScript Helper to send a whisper. I need to know how to send a whisper from the EBS to a listening clientId.
It is still active, I am doing it on one of my extensions.
Based on the docs
You have to give an array of users, you can have only one user. You have to use the opaque ID from the jwt of the user for that. Not the twitch user id.
On the frontend the opaque user id is the property userId , from the on Authorized method
On the EBS the opaque user id is opaque_user_id , from the decoded token
Right now you are sending to the twitch user id, not his opaque user id.
After further testing I realized that I should be posting to the channel ID rather than the whisper channel.
Thanks @Breci for your help pointing me in the right direction.
Apologies for reviving the thread, but did you use the developer rig for this? Just wondering, since when using the rig, the message endpoint seems to be sending broadcasts instead of whispers.
My intent was to send a targeted message to a specific user from the EBS using the user’s opaque user id, using the same approach as outlined in safacon’s previous post.
The issue that I’m running into is that even when I specify the target as “whisper-${opaqueId}” when posting to the “extensions/message/${channelId}” endpoint, all of the front ends receive the message in their broadcast listeners.
So I’m wondering if the rig doesn’t handle whispers as the target.
You mentioned you changed the target, but did you also change the pubsub_perms from { send: ['*'] } to { "send":[ "whisper-*" ] } as safacon showed in his working code?
I just got the whisper pubsub working on my new extension, I hope you’re wrong about it going out the window @BarryCarlyon because I only just discovered its a thing and it’s useful. Maybe it’s not used as it’s not really mentioned as a feature or is but not really discoverable.
I’m now using it for items specifically for the broadcaster dashboard, like “have external auth’d” or “this person submitted an answer for you, but i haven’t told everyone else”
To answer your earlier question: I don’t use the dev rig in my development workflow. I use https:// to serve the files over then net and hard refresh after uploading changes. But I imagine that the dev rig is meant to work the same as a live test…
If you upload the files to do a “Hosted Test” and still get the same results then it is a code problem. If using “Hosted Test” allows whispers to be sent properly then it sounds like a bug with the dev rig & should be reported.