Skip to content

Commit

Permalink
adds readme detail
Browse files Browse the repository at this point in the history
  • Loading branch information
dianabarsan committed May 28, 2024
1 parent ea074ed commit ab728fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ const myOtherDb = new PouchDB(
'http://mysite:5984/mydb',
{ auth: { username: 'admin', password: 'pass' }
});
const sessionDb = new PouchDB('http://mysite:5984/mydb', { session: 'existent session cookie' });

await myDb.allDocs();
await myOtherDb.allDocs();
await sessionDb.allDocs();
```

## Overview
Expand All @@ -40,6 +42,8 @@ It supports authentication embedded in the CouchDb URL or as an additional optio

It regenerates the session cookie on expiry and retries the last request, the client should not expect a failed request for an expired cookie.

When given a `session` parameter, a new session will not be requested, instead the passed session cookie will be used as session authentication.

### Testing

Testing requires `docker` and `docker-compose` to launch a CouchDb 3.3.3 container.
Expand Down

0 comments on commit ab728fa

Please sign in to comment.