Skip to content

pgte/pouchdb-ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pouchcb-ws

PouchDB over websockets provider.

Goes well with pouchdb-ws-proxy.

Install

$ npm install pouchdb-ws --save

Initialize

(Assuming server-side or using Browserify):

var PouchDB = require('pouchdb')
var PouchWS = require('pouchdb-ws');
PouchWS.init(PouchDB);

Use

var remoteDB = new PouchDB('ws://hostname.example.com/mydatabase');

remoteDB.get('key', function(err, value) {
  if (err) {
    console.log('error:', err);
  }
  else {
    console.log('key value is', value);
  }
});

Authentication

You can use a special authenticate command to authenticate a session into the server proxy:

PouchWS.authenticate(token);

License

MIT

About

PouchDB over websockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published