Registry / storage / verdaccio-mongodb

verdaccio-mongodb

JSON →
library1.2.0jsnpmunverified

MongoDB Authentication plugin for Verdaccio. Current stable version is 1.2.0. This plugin enables Verdaccio to use MongoDB or compatible databases (e.g., AWS DocumentDB) as the user store, supporting bcrypt password encryption, custom field mappings, group-based access control, and optional activity counting. It is an alternative to Verdaccio's built-in htpasswd storage and other database-backed plugins like verdaccio-sqlite. The plugin has been in maintenance mode with infrequent updates; its dependency chain includes MongoDB driver interfaces.

npm install verdaccio-mongodb
INSTALL
IMPORT
SIG · VERDACCIO-MONGODB
V
verdaccio-mongodb
storagejavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import verdaccioMongodb from 'verdaccio-mongodb'
const verdaccioMongodb = require('verdaccio-mongodb')
Plugin is used via Verdaccio configuration file (config.yaml), not directly imported in code.
VerdaccioMongodbPlugin
import { VerdaccioMongodbPlugin } from 'verdaccio-mongodb'
Type-only symbol for TypeScript projects; not needed for runtime configuration.
Config
import { Config } from 'verdaccio-mongodb'
TypeScript interface for plugin configuration options.

Configures Verdaccio to use MongoDB for authentication and package access control with custom field mappings and rights.

// No programmatic usage; configure via config.yaml: // auth: // mongodb: // uri: "mongodb+srv://admin:password@cluster.mongodb.net/verdaccio" // db: "verdaccio" // collections: // users: "users" // packages: "packages" // encryption: "bcrypt" // allowAddUser: true // cacheTTL: 300000 // adminGroup: "&admin" // fields: // username: "username" // password: "password" // usergroups: "usergroups" // rights: // access: "user" // publish: "maintainer" // unpublish: "maintainer"
Debug
Known issues
breakingPlugin requires Node.js >=10; Node.js 10 is end-of-life.
fix
Consider upgrading Node.js or using a maintained Node.js LTS version.
affects: >=1.0.0
deprecatedThe 'cacheTTL' option is measured in ms but might be misinterpreted as seconds; documentation defaults to 300000 (5 minutes).
fix
Ensure your configuration uses milliseconds (e.g., 300000 for 5 minutes).
affects: >=1.0.0
gotchaPlugin uses bcrypt for password encryption; if you switch encryption to 'none', passwords are stored in plain text.
fix
Always set encryption to 'bcrypt' unless you understand the security implications.
affects: >=1.0.0
breakingThe 'adminGroup' default changed from '__admin__' to '&admin' in some versions; check your config.
fix
Set adminGroup explicitly to avoid relying on defaults.
affects: <1.2.0
gotchaThe 'collections.packages' is optional but if omitted, activity counting will not work.
fix
If you need activity counting, ensure 'collections.packages' is defined.
affects: >=1.0.0
deprecatedThis plugin is in maintenance mode; no active development since 2020.
fix
Consider forking or using an alternative plugin like verdaccio-sqlite or verdaccio-ldap.
affects: >=1.0.0
Errors
Common errors & fixes
Error: MongoError: Authentication failed.
Wrong MongoDB URI or credentials.
fix
Check the 'uri' field in config.yaml; ensure username/password are correct and URL-encoded if special characters.
Error: Plugin initiated without valid configuration. Check your config file 'mongodb'. You might need to add an 'uri'.
Missing required 'uri' configuration option.
fix
Add 'uri' under 'auth.mongodb' in config.yaml.
Error: Cannot find module 'bcrypt'
bcrypt not installed; the plugin expects bcrypt as peer dependency (or bundled).
fix
Install bcrypt globally: npm install -g bcrypt
Error: User not found or password does not match.
Invalid login credentials or user does not exist in the specified users collection.
fix
Verify the user exists in MongoDB collection and the password is hashed correctly (bcrypt).
Error: fields.username missing in configuration
The 'fields' section in config.yaml is missing the 'username' field.
fix
Add 'fields.username' to config.yaml or remove the 'fields' section to use defaults.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
verdacciorequiredRuns as a plugin inside Verdaccio; requires Verdaccio to be installed and configured.
Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
verdaccio-mongodb — npm install verdaccio-mongodb · libregistry