Skip to content

Commit

Permalink
Update usage (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: Renée <renee@kooi.me>
  • Loading branch information
kidonng and goto-bus-stop committed Mar 9, 2023
1 parent 300e50f commit 0315f8c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ var Keyv = require('keyv')
var KeyvFirestore = require('keyv-firestore')

const keyv = new Keyv({
store: KeyvFirestore,
// REQUIRED: the project id to use
projectId: 'my-firebase-project',
// REQUIRED: the root collection to store things in
collection: 'firestore-db-collection'
store: new KeyvFirestore({
// REQUIRED: the project id to use
projectId: 'my-firebase-project',
// REQUIRED: the root collection to store things in
collection: 'firestore-db-collection'
})
})
```

You can set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to configure credentials, or pass in a JavaScript object in the `credentials` option.

```js
const keyv = new Keyv({
store: KeyvFirestore,
projectId: 'my-firebase-project',
collection: 'firestore-db-collection',
credentials: require('./path/to/google-credentials.json')
store: new KeyvFirestore({
projectId: 'my-firebase-project',
collection: 'firestore-db-collection',
credentials: require('./path/to/google-credentials.json')
})
})
```

Expand Down

0 comments on commit 0315f8c

Please sign in to comment.