whatsapp-api
whatsapp-api copied to clipboard
Enhancement: Add remote auth
Hello, can you please provide more details?
Restoring the session The same object you get from the authenticated event can be passed as an option when creating the client:
const { Client, RemoteAuth } = require('whatsapp-web.js');
// Require database
const { MongoStore } = require('wwebjs-mongo');
const mongoose = require('mongoose');
// Load the session data
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();
});
currently we are using local authentication , can we use remote auth and store session details on mongo db
@ChetanMotghare we will put that in the roadmap, thanks for the suggestion. If you have time you can also PR 🙂