apollo-passport-rethinkdbdash
Version:
rethinkdbdash driver for apollo-passport
45 lines (31 loc) • 1.89 kB
Markdown
rethinkdbdash driver for apollo-passport
[](https://www.npmjs.com/package/apollo-passport-rethinkdbdash) [](https://circleci.com/gh/apollo-passport/rethinkdbdash) [](https://coveralls.io/github/apollo-passport/rethinkdbdash?branch=master) 
Copyright (c) 2016 by Gadi Cohen, released under the MIT license.
```js
import rethinkdbdash from 'rethinkdbdash';
import RethinkDBDashDriver from 'apollo-passport-rethinkdbdash';
// However you usually create your "r" instance
const r = rethinkdbdash({
db: "myApp",
servers: [ { host, port } ]
});
// Pass to apollo passport at creation time
const apolloPassport = new ApolloPassport({
// along with any other relevant options
db: new RethinkDBDashDriver(r)
});
```
**Optional parameters**, e.g. if your `users` table is called something else:
```js
new RethinkDBDashDriver(r, {
userTableName: 'users',
configTableName: 'apolloPassportConfig',
db: '(override default database given to rethinkdbdash)'
});
```
See [apollo-passport](https://github.com/apollo-passport/apollo-passport) for more info.
This package is fully documented with 100% test coverage. It can be used as a basis for creating other DBDrivers for Apollo Passport.
See also the [API Docs](docs/api/apollo-passport-rethinkdbdash), ordered by version and viewable online via rawgit, e.g. [v0.0.2 API Docs on RawGit](https://cdn.rawgit.com/apollo-passport/rethinkdbdash/master/docs/api/apollo-passport-rethinkdbdash/0.0.2/RethinkDBDashDriver.html).