Skip to content

adaptabi/pouchdb-adapter-http-jwt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pouchdb-adapter-http-jwt

PouchDB adapter using HTTP with JSON Web Token support (e.g. a remote CouchDB or CouchDB-like database with JWT authorization) as its data store.

It is forked from the original pouchdb-adapter-http

Tested against express-jwt-pouchdb

Usage

npm i https://github.com/gyetvan-andras/pouchdb-adapter-http-jwt.git
var PouchDB = require('pouchdb-core')
  .plugin(require('pouchdb-adapter-http-jwt'))
  .plugin(require('pouchdb-mapreduce'))
  .plugin(require('pouchdb-replication'));

const _token = () => {
    return 'my secret token'
}

var db = new PouchDB('http://127.0.0.1:5984/mydb',{jwtauth: {token:_token}})
db.allDocs().then((res) => {
    res.rows.forEach((row) => {
        console.log(row)
    })
}).catch((err) => {
    console.log('Error', err)
})

About

Pouchdb http/https adapter with couch_jwt_auth support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%