ColeWalker / twitch-graphql

A GraphQL wrapper for the twitch api
MIT License
14 stars 2 forks source link

follows pubsub #150

Closed ColeWalker closed 3 years ago

ColeWalker commented 3 years ago

so apparently there is a follow pubsub but i missed it.

example from DomitriusClark

const fetch = require('isomorphic-fetch');
 `https://api.twitch.tv/helix/users/follows?to_id=${user.id}&first=1`;

  await fetch('https://api.twitch.tv/helix/webhooks/hub', {
      method: 'POST',
      body: JSON.stringify({
        'hub.callback': `${process.env.CALLBACK_URL}/api/webhooks`,
        'hub.mode': 'subscribe',
        'hub.topic': followersTopic,
        'hub.lease_seconds': 60 * 60 * 4,
      }),
      headers: {
        'Content-Type': 'application/json',
        authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
        'Client-ID': process.env.CLIENT_ID,
      },
    });