1.5.0 • Published 3 months ago

baileys-mongo v1.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Baileys Mongo

Package made by mrodriguezbegueri for using mongodb to store auth sessions from Baileys package

This package was inspired from baileys-bottle package made by deadlinecode.

This package let you save in mongo the credentials to create whatsapp socket with Baileys package.

Installation

  1. Install the package

    npm i baileys-mongo
  2. Generate prisma scheme. For this create one folder named "prisma" with one file called "shceme.prisma". The file has to be like this:

    datasource db {
    provider = "mongodb"
    url      = env("MONGO_DB_URL")
    }
    
    generator client {
    provider = "prisma-client-js"
    }
model Auth {
id          String  @id @default(auto()) @map("_id") @db.ObjectId
key       String @unique
value String
}
```
  1. Set an env var named "MONGO_DB_URL" with the url of your mongo database. Prisma client request to set a replica for upsert operations

    MONGO_DB_URL=mongodb+srv://USER:PASSWORD@CLUSTERXXXX.XXXX.mongodb.net/sessions?retryWrites=true&w=majority
  2. Run prisma generate command

    npx prisma generate --schema=./prisma/scheme.prisma

Usage

Take a look at the information in the example folder

You need help or want to exchange about things

Send me an email to mrodriguezbegueri@gmail.com

1.5.0

3 months ago

1.4.2

7 months ago

1.4.1

7 months ago

1.4.0

7 months ago

1.3.3

7 months ago

1.3.2

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.2.12

7 months ago

1.1.12

8 months ago

1.0.12

8 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago