Change feed- webhooks sync gateway 2.1

i’m trying to set a sync gateway web-hook in Nodejs.
Previously i used iriscouch/follow package, but i saw that after updating SG to 2.1 community edition, the feed doesn’t work anymore, and every time i save a document, the onFeed callback is not called…
The sync_gateway.json:

  "CORS": {
     "Headers": ["Content-Type"]
  "admin_interface": ":4985",
  "databases": {
    "omnitrace_cluster": {
      "bucket": "omnitrace",
      "password": "123123",
      "username": "Administrator",
      "enable_shared_bucket_access": true,
      "use_views": true,
      "users": {
        "GUEST": {"disabled": false, "admin_channels": ["*"]}
      "sync": `function (doc, oldDoc) {

The feed bootstrap file

 * Registering the sync gateway listener
const config = require('../config/database')

const host =
const protocol = config.couchbase.protocol
const clusterName = config.couchbase.cluster
const port = config.couchbase.sync_gateway_port

const follow = require('follow')

const opts = {
  db: `${protocol}://${host}:${port}/${clusterName}`,
  include_docs: true,
  since: 'now'
const feed = new follow.Feed(opts)

feed.on('change', async (change) => {
//some stuff
feed.on('error', async (error) => {
  console.log('Error in couchbase provider sync follow')


I saw in the documentation that the right approach is to use either change feed or web-hooks

I was wondering if someone could explain me better the workflow, because the docs are a bit confusing.
In particular, i didn’t understand if the web-socket connection should be made by the server(like iriscouch/follow) or in the client.
Also, for better performance it is recommend to implement change feed hooks rather than webhooks, right?

Thanks in advance

Webhooks are slightly easier to use, however if you have any downtime on the webhook listener you can miss webhooks, and there is no way for Sync Gateway to know that it needs to retry.

With the changes feed, you can pass in your “last known sequence” checkpoint and it will give you all the changes since that sequence.

To use the changes feed, you can use the HTTP REST API directly if you can’t find a library which works well. The REST API is documented here:

It’s HTTP longpoll based, and so the call will block until new changes show up, or a timeout is reached.

If the docs need more clarification, please post your questions here and I’ll get a docs ticket opened to improve them.

i’m very sorry to answer now, but i was very busy and cannot work on that.
I’m trying to use continuous feed. I tried to add this code at the start of my node server:

const axios = require('axios');

// Make a request for a user with a given ID
  .then(function (response) {
    // handle success
  .catch(function (error) {

In theory if i edit/create a document should increment last_seq and notify the function, but instead every time i change some doc the last_seq is always the same and the server is not notified.

I’m using Couchbase community 6 and SG 2.1 with the settings show above.

What am i doing wrong?