title: How do I watch channel in Google Calendar API using node.js?
body: <pre><code>module.exports.hook = (req, res) =&gt; {
    resourceId = req.headers['x-goog-resource-id'];
    console.log('received signal from Google');
    console.log('listen on channel ID: ', req.headers['x-goog-channel-id']);
    console.log('and resource ID is:', req.headers['x-goog-resource-id']);
    listEvents(auth);
  };
  
  module.exports.createChannel = (id, callback) =&gt; {
    const calendar = google.calendar({ version: 'v3', auth });
    calendar.events.watch({ // post method
      auth,
      calendarId: 'primary',
      resource: {
        id,
        type: 'web_hook',
        address: `https://super.eu.ngrok.io/notifications?id=${id}`,
      },
    }, (error, result) =&gt; {
      if (error) throw error;
      callback(result);
    });
  };
  </code></pre>
  
  <p>This is what I tried. I couldn't find any specific info. Please help out. Thanks in advance. I'm quite new to Google API's.</p>