Hi
I was having the same issue. I was following the documentation but was getting that as well but when I did this below it worked for me.
const custom_options = {
"jwt_secret": {
"encoded": true, //default is to assume base64, will decode for you
"expires": 1503343947, //for signing jwts
"enabled": true, //enable below options
"method":"path",//path to file that holds jwt_secret
"location": "../../config/variables" //file with jwt_secret variable
},
"client_id": "some client id",
"client_secret": "some client secret"
}
const twitchext = require('twitchext-helper')(custom_options);
//can also be done with 'jsonwebtoken' module
var signedToken = twitchext.sign({
channel_id: ""+channel_id,
role: "external",
pubsub_perms: {
listen: [ 'broadcast' ], send: [ '*' ]
}});
Not 100% sure why it worked but when i added that extra "listen: [‘broadcast’] in pubsub_perms it started working after that