pouchdb-security (v4.2.0) is a plugin for PouchDB that enforces database access restrictions via a CouchDB-compatible security document. It validates user permissions for read, write, admin roles against the `_security` doc. Part of the PouchDB ecosystem with irregular releases; key differentiator is its server-side enforcement when used with pouchdb-server/express-pouchdb, supporting both Node.js and browser environments.
npm install pouchdb-securityVerified import paths — ran on the pinned version, not inferred.
Registers the pouchdb-security plugin, creates a database, sets a security document, and attempts to fetch a document with authentication.
Use import syntax or upgrade to an ESM-compatible environment.
Use with pouchdb-server or express-pouchdb to enforce restrictions.
Use a proper authentication proxy or server-side auth middleware.
Run 'npm install pouchdb-security' and ensure it is in package.json.
Ensure import PouchDB from 'pouchdb' is called before PouchDB.plugin(Security).
Call db.putSecurity() with an appropriate security object before enforcing access.