wwebjs-mongo
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

wwebjs-mongo

A MongoDB plugin for whatsapp-web.js!

Use MongoStore to save your WhatsApp MultiDevice session on a MongoDB Database.

Quick Links

Installation

The module is now available on npm! npm i wwebjs-mongo

Example usage

const { Client, RemoteAuth } = require('whatsapp-web.js');
const { MongoStore } = require('wwebjs-mongo');
const mongoose = require('mongoose');

mongoose.connect(process.env.MONGODB_URI).then(() => {
    const store = new MongoStore({ mongoose: mongoose });
    const client = new Client({
        authStrategy: new RemoteAuth({
            store: store,
            backupSyncIntervalMs: 300000
        })
    });

    client.initialize();
});

Delete Remote Session

How to force delete a specific remote session on the Database:

await store.delete({session: 'yourSessionName'});

Package Sidebar

Install

npm i wwebjs-mongo

Weekly Downloads

1,606

Version

1.1.0

License

ISC

Unpacked Size

3.97 kB

Total Files

5

Last publish

Collaborators

  • jtouris