I need example webhooks "Topic: Subscription Events" with nodejs

this is my code.

var clientID = 'myID'
		var contentType = 'application/json'
		var postURI = 'https://api.twitch.tv/helix/webhooks/hub'
		var secret = 'secretvalue'
		var options =
				headers: {
					'Client-ID': clientID,
					'Content-Type': contentType
				uri: postURI,
				method: 'POST',
				json: {

and respone is

{ error: 'Bad Request',
 status: 400,
 message: 'auth token is required' } }

idk how to use Topic: Subscription Events.

Just like the error says, you need to use an auth token.

The subscriptions endpoint requires a User Access Token with the channel:read:subscriptions scope.

The owner of the channel that you want subscriber data for needs to go through your OAuth process to grant you an auth token, and then you can add it to the request as the Authorization header.


Each Webhook’s topic you can test if you can subscribe to the topic by making a fetch call to the topic as each topic has a corresponding helix end point.

So if you can fetch https://api.twitch.tv/helix/subscriptions/events?broadcaster_id=123456789&first=1 then you can create a webhook subscription for it. (easy way to test your token is correct without making a subscription and waiting for data to occur or a denied response)

1 Like

thx reply.
i solved, can respone message ‘Accept’ but no received data from POST.
my code is >
route.post(’/send’,function (req,res) {
req.on(‘data’,function(chunk) {
var data = ‘’;
data += chunk.toString();
var rst = JSON.parse(data);

route.get('/send',function (req,res) {

thank you.

thx reply!

i will try this too!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.