await request({
url: 'https://api.twitch.tv/helix/webhooks/hub',
method: 'POST',
headers: {
'Client-ID': "<clientid>",
'Content-Type': 'application/json',
'Authorization':'Bearer '+<token>
},
form: {
'hub.callback': 'https://<ngrok things>.ngrok.io/twitch/webhook',
'hub.mode': 'subscribe',
'hub.topic': 'https://api.twitch.tv/helix/users/follows?first=1&to_id=<channelid>',
'hub.lease_seconds': 864000,
'hub.secret': "<secret>"
},
json: true
}, (err, res, body) => {
if(err) console.log(err)
//console.log(res)
This is my subscription request
app.get('/twitch/webhook', (req, res) => {
// confirms subscription
console.log(req.query["hub.challenge"]," challange code")
res.writeHead(200, {'Content-Type': 'text/plain'});
res.send(req.query['hub.challange'])
});
Im sending the hub.challange back with text/plain header ( i try it without header too ) but when i check my subscriptions its “0” whats wrong also i cant get POST request’s from webhooks too
how can i close this thread