Hey @BarryCarlyon I tried this
const sec = "mysecret_key";
const secret = Buffer.from(sec, "base64");
const bearerPrefix = "Bearer ";
const sigChatPayload = {
exp: Math.floor(new Date().getTime() / 1000) + 4,
channel_id: "152826156",
role: "external",
};
const sigChat = jsonwebtoken.sign(sigChatPayload, secret);
const client_id = "y7aqa290cuap0tqrvs44t3wr9qu20f";
got({
url: "https://api.twitch.tv/helix/extensions/chat",
method: "POST",
headers: {
"Client-ID": client_id,
Authorization: "Bearer " + sigChat,
},
json: {
broadcaster_id: 152826156,
text: "This is a Test Message Kappa",
extension_id: client_id,
extension_version: "0.0.1",
},
responseType: "json",
})
.then((resp) => {
// console log out the useful information
// keeping track of rate limits is important
// you can only set the config 12 times a minute per segment
console.error(
"Send Chat OK",
resp.statusCode,
resp.headers["ratelimit-remaining"],
"/",
resp.headers["ratelimit-limit"]
);
// we don't care too much about the statusCode here
// but you should test it for a 204
})
.catch((err) => {
if (err.response) {
console.error("Errored", err.response.statusCode, err.response.body);
return;
}
console.error(err);
});
But still getting
I am live on the broadcaster channel and have the extension installed there as well
