PouchDB over websockets provider.
Goes well with pouchdb-ws-proxy.
$ npm install pouchdb-ws --save
(Assuming server-side or using Browserify):
var PouchDB = require('pouchdb')
var PouchWS = require('pouchdb-ws');
PouchWS.init(PouchDB);
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);
}
});
You can use a special authenticate command to authenticate a session into the server proxy:
PouchWS.authenticate(token);
MIT