PouchDB Sync

PouchDB runs in the browser and syncs with CouchDB for offline-first applications.

Syntax

couchdb
localDb.sync(remoteDb, { live: true, retry: true })

Example

couchdb
import PouchDB from 'pouchdb';
const local = new PouchDB('myapp');
const remote = new PouchDB('https://couch.example.com/myapp');

local.sync(remote, { live: true, retry: true })
  .on('change', info => console.log('synced', info));