Closed AKAZAMD closed 3 months ago
The usual answer "You have to implement it yourself" https://github.com/WhiskeySockets/Baileys/issues/182 :) Here's a good start where I started recently implementing it https://github.com/salman0ansari/whatsapp-api-nodejs/blob/main/src/api/helper/mongoAuthState.js
Bascily you need to implement an interface with few methods:
creds
- it's an Object with a complex structure, but it doesn't matter for our case. It must be prepopulated before you run the client (fetched from previously saveCreds
keys
- key value mapping for keys. Nothing fancy, just save it in database on set
and return on get
saveCreds
- it's called when there's new auth info, here you'll save the creds
The usual answer "You have to implement it yourself" #182 :) Here's a good start where I started recently implementing it https://github.com/salman0ansari/whatsapp-api-nodejs/blob/main/src/api/helper/mongoAuthState.js
Give me an example
I want to save the session files in Mongodb to make it more practical and lighter, is that possible?