baileys-mongodb
v1.0.5
Published
mongodb external session for baileys
Downloads
449
Readme
Baileys Session (MongoDB)
multi session baileys created on mongodb databases
how to use ?
First, you need to add the session package in package.json. You can use the github or npm version
version github
"session": "github.com/amiruldev20/baileys-session#mongodb"
version npm
"session": "npm:baileys-mongodb"
{
"name": "myproject",
"version": "1.0.1",
"author": "Sherly",
"dependencies": {
"session": "github:amiruldev20/baileys-session#mongodb"
// and other your depen
}
}
Second step, please call the useMongoAuthState function on your client. Example code is below
// for esm import
import { useMongoAuthState } from "session"
// for cjs import
const { useMongoAuthState } = require("session")
// next code (support all)
const { state, saveCreds, clear, removeCreds, query } =
await useMongoAuthState("urlmongo", {})
Note:
If there are bugs, please report & open an issue in the main repo.