WPPConnect Team
WPPConnect Server


Welcome to the WPPConnect Server repository, developed by the WPPConnect Team. Our mission is to provide a robust and ready-to-use API for seamless communication with WhatsApp. The server is designed to streamline the process of sending and receiving messages, managing contacts, creating groups, and much more, all while leveraging the power of JavaScript ES6, NodeJS, and a RESTful architecture.
- Javascript ES6
- NodeJS
- Restfull
Our online channels
Connect with us across various platforms to stay updated and engage in discussions:

Documentations
Detailed documentation and guides are available for your convenience:
- Postman
- Swagger
- Swagger UI can be accessed on your server through the route: "IP:PORT/api-docs"
Features
| |
---|
Multiple Sessions | ✔ |
Send text, image, video and docs | ✔ |
Get contacts list | ✔ |
Manage products | ✔ |
Receive/Send messages | ✔ |
Open/Close Session | ✔ |
Change Profile/Username | ✔ |
Create Group | ✔ |
Join Group by Invite Code | ✔ |
Webhook | ✔ |
Libraries Used
- WPPConnect
- Axios
- Bcrypt
- Cors
- Dotenv
- Express
- Nodemon
- SocketIO
- S3
Installation
Install the dependencies and start the server.
yarn install
//or
npm install
Install puppeteer dependencies:
sudo apt-get install -y libxshmfence-dev libgbm-dev wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils libvips-dev
Install google chrome
wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get update
sudo apt-get install libappindicator1
sudo dpkg -i google-chrome-stable_current_amd64.deb
Troubleshooting
If you encounter installation issues, please try the procedures below
. Error Sharp Runtime
yarn add sharp
npm install --include=optional sharp
//or
yarn add sharp --ignore-engines
Run Server
yarn dev
Build Server
yarn build
Configuration
This server use config.ts file to define some options, default values are:
{
secretKey: 'THISISMYSECURETOKEN',
host: 'http://localhost',
port: '21465',
deviceName: 'WppConnect',
poweredBy: 'WPPConnect-Server',
startAllSession: true,
tokenStoreType: 'file',
maxListeners: 15,
customUserDataDir: './userDataDir/',
webhook: {
url: null,
autoDownload: true,
uploadS3: false,
awsBucketName: null,
readMessage: true,
allUnreadOnStart: false,
listenAcks: true,
onPresenceChanged: true,
onParticipantsChanged: true,
onReactionMessage: true,
onPollResponse: true,
onRevokedMessage: true,
onLabelUpdated: true,
ignore: [],
},
websocket: {
autoDownload: false,
uploadS3: false,
},
chatwoot: {
sendQrCode: true,
sendStatus: true,
},
archive: {
enable: false,
waitTime: 10,
daysToArchive: 45,
},
log: {
level: 'silly',
logger: ['console', 'file'],
},
createOptions: {
browserArgs: [
'--disable-web-security',
'--no-sandbox',
'--disable-web-security',
'--aggressive-cache-discard',
'--disable-cache',
'--disable-application-cache',
'--disable-offline-load-stale-cache',
'--disk-cache-size=0',
'--disable-background-networking',
'--disable-default-apps',
'--disable-extensions',
'--disable-sync',
'--disable-translate',
'--hide-scrollbars',
'--metrics-recording-only',
'--mute-audio',
'--no-first-run',
'--safebrowsing-disable-auto-update',
'--ignore-certificate-errors',
'--ignore-ssl-errors',
'--ignore-certificate-errors-spki-list',
'--disable-features=LeakyPeeker'
],
},
mapper: {
enable: false,
prefix: 'tagone-',
},
db: {
mongodbDatabase: 'tokens',
mongodbCollection: '',
mongodbUser: '',
mongodbPassword: '',
mongodbHost: '',
mongoIsRemote: true,
mongoURLRemote: '',
mongodbPort: 27017,
redisHost: 'localhost',
redisPort: 6379,
redisPassword: '',
redisDb: 0,
redisPrefix: 'docker',
},
aws_s3: {
region: 'sa-east-1',
access_key_id: '',
secret_key: '',
defaultBucketName: ''
},
}
Secret Key
Your secretKey
is inside the config.ts
file. You must change the default value to one that only you know.
Generate Token
To generate an access token, you must use your SECRET_KEY
.
Using the route:
curl -X POST --location "http://localhost:21465/api/mySession/THISISMYSECURETOKEN/generate-token"
Response:
{
"status": "Success",
"session": "mySession",
"token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
"full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
}
Using Token
Save the value of the "full" response. Then use this value to call the routes.
Examples
curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
curl -X POST --location "http://localhost:21465/api/mySession/send-message" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Accept: application/json" \
-H "Authorization: Bearer \$2b\$10\$8aQFQxnWREtBEMZK_iHMe.u7NeoNkjL7s6NYai_83Pb31Ycss6Igm" \
-d "{
\"phone\": \"5511900000000\",
\"message\": \"*Abner* Rodrigues\"
}"
See the routes file
for all the routes. here and HTTP file.
Swagger UI
Swagger ui can be found at /api-docs