My EBS is getting a 204 http code, which means it was created.
My body for the PubSub creation looks like this: {"content_type":"application/json", "message":"{\"foo\":\"bar\"}", "targets":["broadcast"]}
I tried to create a PubSub message with window.Twitch.ext.send() and I am getting a 204 on the request in the chrome dev “network” tab, but nothing happens in the listen() function.
Note that ChannelID in your JWT payload needs to casted to a string.
And you need to post to the right channelID in https://api.twitch.tv/extensions/message/27419011
If you post a VALID JWT payload with one channelID to the DIFFERENT channel ID it 204’s in error.
I noticed now that the “onError()” function prints this on first load of the extension:
Error: ERR_BADAUTH
at e.notifyOnError (twitch-ext.min.js:8)
at Object.failure (twitch-ext.min.js:8)
at t.value (twitch-ext.min.js:8)
at t.value (twitch-ext.min.js:1)
at t.value (twitch-ext.min.js:8)
If I right click the iframe and refresh this message doesn’t come up.
Casting the channel_id to string didn’t work, also I am pretty sure it’s a string already but even with explicit casting it didn’t change anything.
Yeah, I guess I misunderstood the docs… It says “Authentication
Signed JWT (Twitch or EBS JWTs are allowed)” which I interpreted as either the JWT from Twitch or a self-crafted one.
Another question. Is it possible to use another target than “broadcast”? I get the ERR_BADAUTH error if I try to listen to something else than “broadcast”. I am signed in as the channel user.