Couchbase Sync Gateway 3.1 and PouchDB

Hello, I saw there are two blog posts on how to use Couchbase and PouchDB, but these are old referencing usage of Sync Gateway 2.8.

Is it possible to use Couchbase Sync Gateway 3.1 and PouchDB?

I managed to connect it using old config and setting disable_persistent_config to true.

Here is my full config for local Sync Gateway 3.1, I hope it will help someone:

{
  "disable_persistent_config": true,
  "use_tls_server": false,
  "databases": {
    "couchbase": {
      "server": "http://couchbase-server:8091",
      "bucket": "messages",
      "username": "Administrator",
      "password": "password",
      "num_index_replicas": 0,
      "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } }
    }
  },
  "CORS": {
    "Origin": ["http://localhost:63342"],
    "LoginOrigin": ["http://localhost:63342"],
    "Headers": ["Content-Type"]
  },
  "logging": {
    "console": {
      "enabled": true,
      "log_level": "info",
      "log_keys": ["HTTP"]
    }
  }
}

And for PouchDB on client side:
const db = new PouchDB('http://localhost:4984/couchbase')

Does anyone know PouchDB compatibility with Couchbase Sync Gateway 3.1.x?

Scopes and collections are not supported, since they’re a Couchbase-specific feature, but using the default collection should still work.

We maintain the CouchDB-compatible API on a best-effort basis. Neither PouchDB nor Couchbase provide official interoperability support or compatibility guarantees.

1 Like

okay, thanks. Also, Could you confirm if Sync Gateway now supports wildcard whitelisting of domains?