[Help request] I keep getting 403 JWT could not be verified while trying to use send pubsub extension

Hey, I know the error is probably coming from me, but I can’t seem to understand why my JWTs aren’t verified.

I’m using https://github.com/auth0/node-jsonwebtoken to encode the JWT.

const jwt = require('jsonwebtoken');
const axios = require('axios');
const secret = 'X'; // Secret found in Extension > Manage > Setting > Secret Keys | Freshly generated

const payload = {
    exp: Math.floor(Date.now() / 1000) + (60 * 60),
    user_id: '41677043', 
    role: 'external'
};

let token = jwt.sign(payload, secret, {noTimestamp: true}); // no timestamp to have a jwt without iat prop

axios
    .request({
        method: 'POST',
        url: 'https://api.twitch.tv/extensions/message/41677043',
        headers: {
            'Authorization': 'Bearer ' + token,
            'Client-Id': 'khjec2vpsdgrumaf9l4cudpl9ca8ol', // Id found in manage "About this extension"
            'Content-Type': 'application/json'
        },
        data: {
            message:'test!',
            targets:['broadcast'],
            content_type:'application/json'
        }
    })
    .then(console.log)
    .catch(console.error);

setTimeout(() => {
    console.log(jwt.verify(token, secret));
},1000);

The request results in a

{
error: 'Forbidden',
status: 403
message: '403: Error (403): JWT could not be verified'
}

If someone could tell me what’s wrong with this code that would help me a lot

You need to base64 decode your secret.

const secret = Buffer.from(‘sOmESecReT=’, ‘base64’);

Thanks !
I was able to get it working, I totally missed the part where it said to base 64 encode.