JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2177
  • Score
    100M100P100Q131085F
  • License ISC

A MongoDB plugin for whatsapp-web.js library

Package Exports

  • wwebjs-mongo
  • wwebjs-mongo/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wwebjs-mongo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

wwebjs-mongo

A MongoDB plugin for whatsapp-web.js!

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

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'});