MongoDB plugin for whatsapp-web.js to persist WhatsApp MultiDevice sessions. v1.1.0 is the current stable release. It uses Mongoose under the hood to store session data in MongoDB, enabling session recovery across app restarts. Key differentiator: it is the official MongoDB store for TheRemoteAuth strategy in whatsapp-web.js, replacing the default in-memory store. Simple to integrate with just a few lines of code.
npm install wwebjs-mongoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WhatsApp client with MongoDB session persistence using RemoteAuth and MongoStore.
Pass the mongoose instance: new MongoStore({ mongoose: mongoose })Ensure you are using RemoteAuth as shown in the quickstart.
Use await store.delete({ session: 'yourSessionName' })Implement your own reconnection logic outside this package.
Call mongoose.connect() before new MongoStore(...).
Use const { MongoStore } = require('wwebjs-mongo') or import { MongoStore } from 'wwebjs-mongo'.Pass the mongoose instance: new MongoStore({ mongoose: require('mongoose') })Check MONGODB_URI and ensure user has read/write permissions on the target database.