@wppconnect/server 2.10.71 → 2.10.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [2.10.73](https://github.com/wppconnect-team/wppconnect-server/compare/v2.10.72...v2.10.73) (2026-10-31)
2
+
3
+ ## [2.10.72](https://github.com/wppconnect-team/wppconnect-server/compare/v2.10.71...v2.10.72) (2026-10-31)
4
+
1
5
  ## [2.10.71](https://github.com/wppconnect-team/wppconnect-server/compare/v2.10.70...v2.10.71) (2026-10-30)
2
6
 
3
7
 
package/README.md CHANGED
@@ -1,319 +1,113 @@
1
- # WPPConnect Team
1
+ **English** | [Português (Brasil)](./README.pt-BR.md)
2
2
 
3
- ## _WPPConnect Server_
3
+ <p align="center">
4
+ <a href="https://wppconnect.io/">
5
+ <picture>
6
+ <source media="(prefers-color-scheme: dark)" srcset="https://wppconnect-team.github.io/brand/wppconnect-dark.png" />
7
+ <img src="https://wppconnect-team.github.io/brand/wppconnect-light.png" alt="WPPConnect" width="220" height="121" />
8
+ </picture>
9
+ </a>
10
+ </p>
4
11
 
5
- ### WPPConnect Manager
12
+ # WPPConnect Server
6
13
 
7
- The Docker image includes [WPPConnect Manager](https://github.com/wppconnect-team/wppconnect-manager) at **http://localhost:21465/manager/**: server profiles, session management and QR pairing, chat, contacts, groups and media, with Portuguese/English and light/dark themes.
14
+ Run a REST API for WhatsApp sessions, messages and webhooks.
8
15
 
9
- Use `SECRET_KEY` for administration, or a session name/token for restricted access. Credentials remain in browser memory. Set `MANAGER_ENABLED=false` to disable serving the UI. The image pins and verifies the Manager bundle during build.
16
+ A project in the WPPConnect ecosystem, maintained by WPPConnect Team.
10
17
 
11
- See [configuration, API, authenticated events and rollback](docs/manager.md). Existing APIs and legacy sockets remain compatible. Live WhatsApp send/receive requires separate validation with an authorized account.
18
+ [Getting started](#getting-started) | [Documentation](#documentation) | [Contributing](#contributing) | [Support WPPConnect](#support-the-project)
12
19
 
13
- ![WPPConnect-SERVER](https://i.imgur.com/y1ts6RR.png)
20
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE) [![npm version](https://img.shields.io/npm/v/@wppconnect/server)](https://www.npmjs.com/package/@wppconnect/server) [![CI](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml) [![Open Collective](https://img.shields.io/badge/Open%20Collective-WPPConnect-blue)](https://opencollective.com/wppconnect)
14
21
 
15
- [![npm version](https://img.shields.io/npm/v/@wppconnect/server.svg?color=green)](https://www.npmjs.com/package/@wppconnect/server)
16
- [![Downloads](https://img.shields.io/npm/dm/@wppconnect/server.svg)](https://www.npmjs.com/package/@wppconnect/server)
17
- [![Docker Pulls](https://img.shields.io/docker/pulls/wppconnect/wppconnect-server?logo=docker)](https://hub.docker.com/r/wppconnect/wppconnect-server)
18
- [![Docker Image Version](https://img.shields.io/docker/v/wppconnect/wppconnect-server?sort=semver&logo=docker)](https://hub.docker.com/r/wppconnect/wppconnect-server/tags)
19
- [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wppconnect-team/wppconnect-server.svg)](https://isitmaintained.com/project/wppconnect-team/wppconnect-server 'Average time to resolve an issue')
20
- [![Percentage of issues still open](https://isitmaintained.com/badge/open/wppconnect-team/wppconnect-server.svg)](https://isitmaintained.com/badge/open/wppconnect-team/wppconnect-server.svg 'Percentage of issues still open')
21
- [![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wppconnect-server/build.yml)](https://github.com/wppconnect-team/wppconnect-server/actions)
22
- [![Build](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml/badge.svg)](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml)
23
- [![release-it](https://img.shields.io/badge/%F0%9F%93%A6%F0%9F%9A%80-release--it-e10079.svg)](https://github.com/release-it/release-it)
22
+ ## Overview
24
23
 
25
- 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.
26
-
27
- - Javascript ES6
28
- - NodeJS
29
- - Restfull
30
-
31
- ## Our online channels
32
-
33
- Connect with us across various platforms to stay updated and engage in discussions:
34
-
35
- [![Discord](https://img.shields.io/discord/844351092758413353?color=blueviolet&label=Discord&logo=discord&style=flat)](https://discord.gg/JU5JGGKGNG)
36
- [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/wppconnect)
37
- [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
38
- [![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect)
39
-
40
- ## Documentations
41
-
42
- Detailed documentation and guides are available for your convenience:
43
-
44
- - [Postman](https://documenter.getpostman.com/view/9139457/TzshF4jQ)
45
- - [Swagger](https://wppconnect.io/swagger/wppconnect-server)
46
- - Swagger UI can be accessed on your server through the route: "IP:PORT/api-docs"
24
+ For integrators who want an HTTP service around the WPPConnect Node.js library. The Docker image also includes WPPConnect Manager for session and chat administration.
47
25
 
48
26
  ## Features
49
27
 
50
- | | |
51
- | ------------------------------------ | --- |
52
- | Multiple Sessions | ✔ |
53
- | Send **text, image, video and docs** | ✔ |
54
- | Get **contacts list** | ✔ |
55
- | Manage products | ✔ |
56
- | Receive/Send messages | ✔ |
57
- | Open/Close Session | ✔ |
58
- | Change Profile/Username | ✔ |
59
- | Create Group | ✔ |
60
- | Join Group by Invite Code | ✔ |
61
- | Webhook | ✔ |
62
-
63
- ## Libraries Used
64
-
65
- - WPPConnect
66
- - Axios
67
- - Bcrypt
68
- - Cors
69
- - Dotenv
70
- - Express
71
- - Nodemon
72
- - SocketIO
73
- - S3
74
-
75
- ## Docker (recommended)
76
-
77
- The official image is available on
78
- [Docker Hub](https://hub.docker.com/r/wppconnect/wppconnect-server). It includes
79
- Node.js, Chromium, and the native dependencies required by WPPConnect.
28
+ - Session pairing, text/media messaging, contacts, groups and product operations.
29
+ - Session tokens, webhooks, authenticated Manager events and Swagger UI.
30
+ - Persistent Docker volumes for credentials, browser data, media and logs.
80
31
 
81
- ```sh
82
- docker run -d \
83
- --name wppconnect-server \
84
- --restart unless-stopped \
85
- -p 21465:21465 \
86
- -e SECRET_KEY=change-me \
87
- -v wppconnect_tokens:/usr/src/wpp-server/tokens \
88
- -v wppconnect_user_data:/usr/src/wpp-server/userDataDir \
89
- wppconnect/wppconnect-server:latest
90
- ```
32
+ ## Getting started
91
33
 
92
- For Docker Compose, clone the repository, copy the example and edit `SECRET_KEY`:
34
+ Use Docker with Compose, or Node.js **22.22.2**, Corepack/Yarn **4.14.1**, Chromium and native dependencies for source development. From the repository root:
93
35
 
94
36
  ```sh
95
37
  cp .env.example .env
96
- # Edit .env and replace SECRET_KEY. In PowerShell, use Copy-Item .env.example .env.
97
- docker compose up -d
98
- docker compose ps
99
- curl http://localhost:21465/healthz
100
38
  ```
101
39
 
102
- Set `WPP_SERVER_TAG` to pin a release instead of following `latest`:
40
+ In PowerShell use `Copy-Item .env.example .env`. Edit `.env` and set a private random `SECRET_KEY` before starting.
103
41
 
104
42
  ```sh
105
- WPP_SERVER_TAG=2.10.18 docker compose up -d
106
- ```
107
-
108
- Release tags follow the GitHub and npm version: `vX.Y.Z`, `X.Y.Z`, `X.Y`,
109
- `X`, and `latest`. The `main`, `develop`, and immutable `sha-*` tags are also
110
- available. See all tags on
111
- [Docker Hub](https://hub.docker.com/r/wppconnect/wppconnect-server/tags).
112
-
113
- The container accepts `PORT`, `HOST`, `SECRET_KEY`, `WEBHOOK_URL`,
114
- `WEBHOOK_AUTO_DOWNLOAD_MAX_SIZE`, `TOKEN_STORE_TYPE`, `CUSTOM_USER_DATA_DIR`, `MAX_LISTENERS`, and the Redis and
115
- MongoDB variables listed in the [Configuration](#configuration) section. The
116
- Compose setup persists tokens, Chromium session data, uploads, received images,
117
- and logs in named volumes. Change the default secret before exposing the API.
118
-
119
- To upgrade the Compose deployment:
120
-
121
- ```sh
122
- docker compose pull
123
43
  docker compose up -d
44
+ docker compose ps
45
+ curl -fsS http://localhost:21465/healthz
124
46
  ```
125
47
 
126
- ## Installation from source
48
+ Open `http://localhost:21465/manager/` and sign in with the configured `SECRET_KEY` to create/pair a session, or use the API at `http://localhost:21465/api-docs`. Session-restricted Manager access uses a session name and token. For source development: `corepack enable`, `yarn install --immutable`, `yarn build`, then `yarn start`.
127
49
 
128
- Install the dependencies, copy `.env.example` to `.env`, and edit `SECRET_KEY`. Node loads `.env` from the directory where you start the server; existing environment variables take precedence. The file is optional.
50
+ ## Configuration
129
51
 
130
- ```sh
131
- yarn install --immutable
132
- cp .env.example .env
133
- # PowerShell: Copy-Item .env.example .env
134
- ```
52
+ [.env.example](.env.example) lists supported environment variables; [src/config.ts](src/config.ts) contains advanced options. Process environment overrides the optional working-directory `.env`, then built-in defaults apply. Restart after changes. Set exact webhook/Chatwoot destinations in `WEBHOOK_ALLOWED_URLS` and `CHATWOOT_ALLOWED_URLS`. Session inventory and backups use POST with `x-secret-key`; legacy GET URLs containing secrets return 410. `MANAGER_ENABLED=false` disables the UI. Preserve the named volumes and pin `WPP_SERVER_TAG` for repeatable deployments.
135
53
 
136
- ## Install puppeteer dependencies:
54
+ ## Documentation
137
55
 
138
- ```sh
139
- 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
56
+ - [Swagger reference](https://wppconnect.io/swagger/wppconnect-server/)
57
+ - [Manager configuration, access and rollback](./docs/manager.md)
58
+ - [HTTP request examples](./requests.http)
59
+ - [Postman collection](https://documenter.getpostman.com/view/9139457/TzshF4jQ)
60
+ - [Retained technical details and acknowledgments](documentation/readme-reference.md)
140
61
 
141
- ```
62
+ ## WPPConnect ecosystem
142
63
 
143
- ## Install google chrome
64
+ | Project | Purpose | When to use it |
65
+ | --- | --- | --- |
66
+ | [WPPConnect](https://github.com/wppconnect-team/wppconnect) | Control WhatsApp Web from Node.js applications. | Embed automation in a Node.js application. |
67
+ | [WPPConnect Manager](https://github.com/wppconnect-team/wppconnect-manager) | Manage WPPConnect Server sessions and conversations in a self-hosted web workspace. | Operate compatible Server sessions and chats through a UI. |
68
+ | [WPPConnect Server CLI](https://github.com/wppconnect-team/server-cli) | Start WPPConnect Server from the `wppserver` command. | Launch the Node.js Server from a terminal. |
69
+ | [WPPConnect Server Go](https://github.com/wppconnect-team/wppconnect-server-go) | Run a browser-free WhatsApp HTTP API built with Go and whatsmeow. | Evaluate a Go HTTP API and documented migration coverage. |
144
70
 
145
- ```sh
71
+ ## Support the project
146
72
 
147
- wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
73
+ WPPConnect is maintained by an open-source community. Your support helps fund maintenance, infrastructure, documentation, and the people working on the ecosystem.
148
74
 
149
- sudo apt-get update
75
+ If WPPConnect helps your project or business, consider making a one-time contribution or becoming a recurring supporter.
150
76
 
151
- sudo apt-get install libappindicator1
77
+ **[Support WPPConnect on Open Collective](https://opencollective.com/wppconnect)**
152
78
 
153
- sudo dpkg -i google-chrome-stable_current_amd64.deb
79
+ Contributions are voluntary. See the official page for current financial information. You can also help with code, tests, documentation, translations and well-described issue reports.
154
80
 
155
- ```
81
+ Additional official beneficiaries in [.github/FUNDING.yml](.github/FUNDING.yml): [joaosouz4dev](https://github.com/sponsors/joaosouz4dev), [manfe](https://github.com/sponsors/manfe).
156
82
 
157
- ### Troubleshooting
158
- If you encounter installation issues, please try the procedures below
159
- . Error Sharp Runtime
160
- ```sh
161
- yarn add sharp
162
- npm install --include=optional sharp
163
- //or
164
- yarn add sharp --ignore-engines
165
- ```
83
+ ## Contributing
166
84
 
167
- ## Run Server
85
+ Contributions of code, tests, examples, documentation and translations are welcome. For larger changes, discuss the approach in an issue first. Include the project/runtime versions, a minimal reproduction and sanitized logs when reporting a problem. Update both `README.md` and `README.pt-BR.md` in the same change when installation, configuration, features, examples, licensing or funding changes.
168
86
 
169
- ```sh
170
- yarn dev
171
- ```
172
-
173
- ## Build Server
87
+ After installing the development dependencies, use the repository checks relevant to your change:
174
88
 
175
89
  ```sh
176
90
  yarn build
91
+ yarn lint
92
+ yarn test
177
93
  ```
178
94
 
179
- ---
180
-
181
- # Configuration
182
-
183
- Configuration defaults remain in [src/config.ts](src/config.ts). Supported environment variables are documented in [.env.example](.env.example); the file is also included in the npm package.
184
-
185
- The default configuration resolves values in this order: existing process environment, optional `.env` in the working directory, then built-in defaults. Restart the process or recreate the container after changing a value. Variables are read at runtime, so changing them does not require rebuilding the image.
186
-
187
- | Area | Variables |
188
- | --- | --- |
189
- | Webhook delivery | `WEBHOOK_RETRY_ATTEMPTS` (total attempts, default 3, range 1-10), `WEBHOOK_RETRY_DELAY` (initial backoff in ms, default 5000, capped at 60000), `WEBHOOK_REQUEST_TIMEOUT` (ms per request, default 30000, range 1-120000) |
190
- | Session webhook destinations | `WEBHOOK_ALLOWED_URLS` (comma-separated exact URLs; session-specific destinations must equal `WEBHOOK_URL` or an entry in this list) |
191
- | Chatwoot destinations | `CHATWOOT_ALLOWED_URLS` (comma-separated exact base URLs the operator approves for session configuration) |
192
- | Server | `SECRET_KEY`, `HOST`, `PORT`, `WEBHOOK_URL` |
193
- | Webhook | `WEBHOOK_AUTO_DOWNLOAD_MAX_SIZE` (bytes; media larger than this is sent without inlined base64 and with `autoDownloadSkipped: true`, fetch it via `download-media`; `0` = no limit) |
194
- | Sessions | `TOKEN_STORE_TYPE`, `CUSTOM_USER_DATA_DIR`, `MAX_LISTENERS` |
195
- | Manager | `MANAGER_ENABLED`, `MANAGER_DIST` |
196
- | Redis | `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`, `REDIS_DB`, `REDIS_PREFIX` |
197
- | MongoDB | `MONGO_URL_REMOTE`, `MONGODB_DATABASE`, `MONGODB_COLLECTION`, `MONGODB_USER`, `MONGODB_PASSWORD`, `MONGODB_HOST`, `MONGODB_PORT` |
198
- | Compose image | `WPP_SERVER_TAG` (used by Compose, not the Node server) |
199
-
200
- Webhook delivery retries transient connection failures with exponential backoff
201
- and the same event payload. HTTP error responses are not retried. The receiver
202
- should deduplicate message events by session, event and message ID, because a
203
- timeout or connection reset can happen after the receiver has processed a request.
204
- Retries are held in memory and do not survive a server restart.
205
-
206
- When using a session-specific webhook, configure its exact destination in
207
- `WEBHOOK_ALLOWED_URLS` or `webhook.allowedUrls` first. An unlisted session URL
208
- is rejected before making a network request. The global `WEBHOOK_URL` remains
209
- the default destination and is also permitted as an explicit session selection.
210
-
211
- Before starting a Chatwoot-enabled session, list its exact `chatWoot.baseURL`
212
- in `CHATWOOT_ALLOWED_URLS` or `serverOptions.chatwoot.allowedUrls`. Self-hosted
213
- and private-network destinations are supported when explicitly listed. Session
214
- requests cannot add destinations. Use an HTTP or HTTPS URL without credentials,
215
- query parameters or a fragment. Chatwoot requests do not follow redirects;
216
- configure the final destination URL. Account, inbox, contact and conversation
217
- identifiers must be numeric.
218
-
219
- Session listing and backup now use `POST /api/show-all-sessions` and
220
- `POST /api/backup-sessions`, respectively. Send the operator `SECRET_KEY` in
221
- the `x-secret-key` header. The former GET URLs containing a secret return 410
222
- and do not list sessions or create a backup. Update clients and remove old
223
- secret-bearing URLs from bookmarks and scripts.
224
-
225
- ```sh
226
- curl -X POST -H "x-secret-key: $SECRET_KEY" http://localhost:21465/api/show-all-sessions
227
- curl -X POST -H "x-secret-key: $SECRET_KEY" http://localhost:21465/api/backup-sessions -o sessions.zip
228
- ```
229
-
230
- For Node, both `yarn dev` and the compiled `yarn start` load the optional file automatically. For example, after setting `PORT=21470` in `.env`, the server listens on port 21470. `HOST` supplies the advertised URL; it does not restrict the listener address.
231
-
232
- Compose reads `.env` for interpolation and explicitly forwards the supported server variables. Setting `PORT=21470` changes both the container listener and the published host port; setting `MANAGER_ENABLED=false` disables `/manager/` while the API remains available. You can select another file with `docker compose --env-file ./.env.production up -d`. Variables defined by the shell take precedence over values in the file.
233
-
234
- For plain Docker, pass variables with `-e` or `--env-file`:
235
-
236
- ```sh
237
- docker run --rm --env-file .env -p 21465:21465 wppconnect/wppconnect-server:2.10.18
238
- ```
239
-
240
- If `PORT` differs from 21465, adjust both sides of `-p` accordingly. Use the persistent volumes shown in the Docker section for regular deployments. Private `.env` files are excluded from image builds and npm packages; `.env.example` remains available. Docker does not need a private file baked into the image.
241
-
242
- Paths in containers refer to the container filesystem. Keep `CUSTOM_USER_DATA_DIR` inside the mounted session-data directory (and retain its trailing slash), or change the volume mapping too. `MANAGER_DIST` points to an existing static bundle; leaving it empty uses the default location. The official Docker image supplies that bundle.
243
-
244
- Redis and MongoDB services must be provisioned separately; the included Compose file starts only WPPConnect. The default MongoDB remote mode uses `MONGO_URL_REMOTE`. Structured MongoDB host/user/port settings apply when `db.mongoIsRemote` is disabled in the advanced configuration.
245
-
246
- Advanced options without an environment mapping, such as browser arguments and webhook event toggles, remain in `src/config.ts` or can be supplied to `initServer(...)` when embedding the server. Changing TypeScript configuration requires rebuilding the compiled server; environment-only changes do not.
95
+ Account-dependent examples and tests require separate validation with an authorized test account. Never attach credentials or session files to an issue.
247
96
 
248
- # Secret Key
97
+ ## Community and support
249
98
 
250
- Set `SECRET_KEY` in `.env` or the deployment environment to a private, randomly generated value. The legacy default is retained for compatibility; replace it before exposing the API. Never commit your private `.env`.
99
+ Use [repository issues](https://github.com/wppconnect-team/wppconnect-server/issues) for reproducible bugs and feature proposals. For usage questions, join the community through the official channels:
251
100
 
252
- <!-- ![Peek 2021-03-25 09-33](https://user-images.githubusercontent.com/40338524/112473515-3b310a80-8d4d-11eb-94bb-ff409c91d9b8.gif) -->
101
+ - [Discord](https://discord.gg/JU5JGGKGNG)
102
+ - [Telegram](https://t.me/wppconnect)
103
+ - [YouTube](https://www.youtube.com/c/wppconnect)
253
104
 
254
- # Generate Token
255
-
256
- To generate an access token, you must use your `SECRET_KEY`.
257
-
258
- Using the route:
259
-
260
- ```shell
261
- curl -X POST --location "http://localhost:21465/api/mySession/THISISMYSECURETOKEN/generate-token"
262
- ```
105
+ This project is independent and is not affiliated with or endorsed by WhatsApp or Meta. Follow applicable terms and obtain authorization for account and messaging operations.
263
106
 
264
- ### Response:
265
-
266
- ```json
267
- {
268
- "status": "Success",
269
- "session": "mySession",
270
- "token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
271
- "full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
272
- }
273
- ```
274
-
275
- # Using Token
276
-
277
- Save the value of the "full" response. Then use this value to call the routes.
278
-
279
- # Examples
280
-
281
- ```sh
282
- #Starting Session
283
- # /api/:session/start-session
284
-
285
- curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
286
- -H "Accept: application/json" \
287
- -H "Content-Type: application/json" \
288
- -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
289
- ```
290
-
291
- ```sh
292
- #Get QrCode
293
- # /api/:session/start-session
294
- # when the session is starting if the method is called again it will return the base64 qrCode
295
-
296
- curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
297
- -H "Accept: application/json" \
298
- -H "Content-Type: application/json" \
299
- -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
300
- ```
301
-
302
- ```sh
303
- #Send Message
304
- # /api/:session/send-message
305
- curl -X POST --location "http://localhost:21465/api/mySession/send-message" \
306
- -H "Content-Type: application/json; charset=utf-8" \
307
- -H "Accept: application/json" \
308
- -H "Authorization: Bearer \$2b\$10\$8aQFQxnWREtBEMZK_iHMe.u7NeoNkjL7s6NYai_83Pb31Ycss6Igm" \
309
- -d "{
310
- \"phone\": \"5511900000000\",
311
- \"message\": \"*Abner* Rodrigues\"
312
- }"
313
- ```
107
+ ## License
314
108
 
315
- See the `routes` file for all the routes. [here](/src/routes/index.js) and HTTP [file](/requests.http).
109
+ [Apache License 2.0 (Apache-2.0)](./LICENSE).
316
110
 
317
- # Swagger UI
111
+ Copyright 2021 WPPConnect Team.
318
112
 
319
- Swagger ui can be found at `/api-docs`
113
+ The original legal document and existing copyright notices are preserved. Third-party components retain their own terms.
@@ -0,0 +1,113 @@
1
+ [English](./README.md) | **Português (Brasil)**
2
+
3
+ <p align="center">
4
+ <a href="https://wppconnect.io/">
5
+ <picture>
6
+ <source media="(prefers-color-scheme: dark)" srcset="https://wppconnect-team.github.io/brand/wppconnect-dark.png" />
7
+ <img src="https://wppconnect-team.github.io/brand/wppconnect-light.png" alt="WPPConnect" width="220" height="121" />
8
+ </picture>
9
+ </a>
10
+ </p>
11
+
12
+ # WPPConnect Server
13
+
14
+ Execute uma API REST para sessões, mensagens e webhooks do WhatsApp.
15
+
16
+ Um projeto do ecossistema WPPConnect, mantido pela WPPConnect Team.
17
+
18
+ [Primeiros passos](#primeiros-passos) | [Documentação](#documentação) | [Como contribuir](#como-contribuir) | [Apoie a WPPConnect](#apoie-o-projeto)
19
+
20
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE) [![npm version](https://img.shields.io/npm/v/@wppconnect/server)](https://www.npmjs.com/package/@wppconnect/server) [![CI](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml) [![Open Collective](https://img.shields.io/badge/Open%20Collective-WPPConnect-blue)](https://opencollective.com/wppconnect)
21
+
22
+ ## Visão geral
23
+
24
+ Para integradores que precisam de um serviço HTTP sobre a biblioteca WPPConnect em Node.js. A imagem Docker também inclui o WPPConnect Manager para administrar sessões e conversas.
25
+
26
+ ## Funcionalidades
27
+
28
+ - Pareamento de sessões, mensagens de texto/mídia, contatos, grupos e operações de produtos.
29
+ - Tokens de sessão, webhooks, eventos autenticados do Manager e Swagger UI.
30
+ - Volumes Docker persistentes para credenciais, dados do navegador, mídia e logs.
31
+
32
+ ## Primeiros passos
33
+
34
+ Use Docker com Compose ou, para desenvolver pelos fontes, Node.js **22.22.2**, Corepack/Yarn **4.14.1**, Chromium e dependências nativas. Na raiz do repositório:
35
+
36
+ ```sh
37
+ cp .env.example .env
38
+ ```
39
+
40
+ No PowerShell use `Copy-Item .env.example .env`. Edite `.env` e defina um `SECRET_KEY` privado e aleatório antes de iniciar.
41
+
42
+ ```sh
43
+ docker compose up -d
44
+ docker compose ps
45
+ curl -fsS http://localhost:21465/healthz
46
+ ```
47
+
48
+ Abra `http://localhost:21465/manager/` e entre com o `SECRET_KEY` configurado para criar/parear uma sessão, ou use a API em `http://localhost:21465/api-docs`. O acesso restrito do Manager usa nome e token de sessão. Para desenvolver pelos fontes: `corepack enable`, `yarn install --immutable`, `yarn build` e `yarn start`.
49
+
50
+ ## Configuração
51
+
52
+ [.env.example](.env.example) lista as variáveis de ambiente aceitas; [src/config.ts](src/config.ts) contém opções avançadas. O ambiente do processo prevalece sobre o `.env` opcional do diretório atual e os valores padrão. Reinicie após mudanças. Autorize os destinos exatos de webhook/Chatwoot em `WEBHOOK_ALLOWED_URLS` e `CHATWOOT_ALLOWED_URLS`. A listagem e o backup de sessões usam POST com `x-secret-key`; os GETs antigos com segredo na URL retornam 410. `MANAGER_ENABLED=false` desativa a interface. Preserve os volumes nomeados e fixe `WPP_SERVER_TAG` para instalações reproduzíveis.
53
+
54
+ ## Documentação
55
+
56
+ - [Referência Swagger](https://wppconnect.io/swagger/wppconnect-server/)
57
+ - [Configuração, acesso e rollback do Manager](./docs/manager.md)
58
+ - [Exemplos de requisições HTTP](./requests.http)
59
+ - [Coleção Postman](https://documenter.getpostman.com/view/9139457/TzshF4jQ)
60
+ - [Detalhes técnicos e agradecimentos preservados](documentation/readme-reference.md)
61
+
62
+ ## Ecossistema WPPConnect
63
+
64
+ | Projeto | Finalidade | Quando usar |
65
+ | --- | --- | --- |
66
+ | [WPPConnect](https://github.com/wppconnect-team/wppconnect) | Controle o WhatsApp Web em aplicações Node.js. | Incorporar automação a uma aplicação Node.js. |
67
+ | [WPPConnect Manager](https://github.com/wppconnect-team/wppconnect-manager) | Gerencie sessões e conversas do WPPConnect Server em uma aplicação web auto-hospedada. | Operar sessões e conversas de um Server compatível pela interface. |
68
+ | [WPPConnect Server CLI](https://github.com/wppconnect-team/server-cli) | Inicie o WPPConnect Server pelo comando `wppserver`. | Iniciar o Server Node.js pelo terminal. |
69
+ | [WPPConnect Server Go](https://github.com/wppconnect-team/wppconnect-server-go) | Execute uma API HTTP do WhatsApp sem navegador, feita com Go e whatsmeow. | Avaliar uma API HTTP Go e a cobertura documentada de migração. |
70
+
71
+ ## Apoie o projeto
72
+
73
+ A WPPConnect é mantida por uma comunidade de código aberto. Seu apoio ajuda a financiar a manutenção, a infraestrutura, a documentação e o trabalho das pessoas que desenvolvem o ecossistema.
74
+
75
+ Se a WPPConnect ajuda seu projeto ou sua empresa, considere fazer uma contribuição pontual ou apoiar de forma recorrente.
76
+
77
+ **[Apoie a WPPConnect no Open Collective](https://opencollective.com/wppconnect)**
78
+
79
+ As contribuições são voluntárias. Consulte a página oficial para acompanhar as informações financeiras atuais. Você também pode ajudar com código, testes, documentação, traduções e relatos de problemas bem descritos.
80
+
81
+ Beneficiários oficiais adicionais em [.github/FUNDING.yml](.github/FUNDING.yml): [joaosouz4dev](https://github.com/sponsors/joaosouz4dev), [manfe](https://github.com/sponsors/manfe).
82
+
83
+ ## Como contribuir
84
+
85
+ Contribuições de código, testes, exemplos, documentação e traduções são bem-vindas. Para mudanças maiores, discuta a proposta em uma issue primeiro. Ao relatar um problema, informe as versões do projeto/runtime, uma reprodução mínima e logs sem dados sensíveis. Atualize `README.md` e `README.pt-BR.md` na mesma alteração quando mudar instalação, configuração, funcionalidades, exemplos, licença ou arrecadação.
86
+
87
+ Após instalar as dependências de desenvolvimento, use as verificações pertinentes à sua alteração:
88
+
89
+ ```sh
90
+ yarn build
91
+ yarn lint
92
+ yarn test
93
+ ```
94
+
95
+ Exemplos e testes que dependem de conta exigem validação separada com uma conta de teste autorizada. Nunca anexe credenciais ou arquivos de sessão a uma issue.
96
+
97
+ ## Comunidade e suporte
98
+
99
+ Use as [issues do repositório](https://github.com/wppconnect-team/wppconnect-server/issues) para bugs reproduzíveis e propostas de funcionalidades. Para dúvidas de uso, participe pelos canais oficiais:
100
+
101
+ - [Discord](https://discord.gg/JU5JGGKGNG)
102
+ - [Telegram](https://t.me/wppconnect)
103
+ - [YouTube](https://www.youtube.com/c/wppconnect)
104
+
105
+ Este projeto é independente e não é afiliado nem endossado pelo WhatsApp ou pela Meta. Siga os termos aplicáveis e obtenha autorização para operações de conta e mensagens.
106
+
107
+ ## Licença
108
+
109
+ [Apache License 2.0 (Apache-2.0)](./LICENSE).
110
+
111
+ Copyright 2021 WPPConnect Team.
112
+
113
+ O documento jurídico original e os avisos de autoria existentes são preservados. Componentes de terceiros mantêm seus próprios termos.
@@ -0,0 +1,336 @@
1
+ # Retained README reference / Referência preservada do README
2
+
3
+ This document preserves the previous `README.md` for technical details, acknowledgments and history. Start with [README.md](../README.md) or [README.pt-BR.md](../README.pt-BR.md) for the current verified entry path. Older commands, release claims, third-party examples and API signatures here may need migration; consult the current source and linked guides.
4
+
5
+ Este documento preserva o `README.md` anterior com detalhes técnicos, agradecimentos e histórico. Comece pelo [README em português](../README.pt-BR.md) para as instruções iniciais conferidas. Comandos antigos, afirmações sobre releases, exemplos de terceiros e assinaturas de API podem exigir migração; consulte os fontes e guias atuais.
6
+
7
+ ---
8
+
9
+ <!-- wppconnect-official-brand -->
10
+ <p align="center">
11
+ <a href="https://wppconnect-team.github.io/">
12
+ <picture>
13
+ <source media="(prefers-color-scheme: dark)" srcset="https://wppconnect-team.github.io/brand/wppconnect-dark.png" />
14
+ <img src="https://wppconnect-team.github.io/brand/wppconnect-light.png" alt="WPPConnect" width="220" height="121" />
15
+ </picture>
16
+ </a>
17
+ </p>
18
+ <!-- /wppconnect-official-brand -->
19
+
20
+ # WPPConnect Team
21
+
22
+ ## _WPPConnect Server_
23
+
24
+ ### WPPConnect Manager
25
+
26
+ The Docker image includes [WPPConnect Manager](https://github.com/wppconnect-team/wppconnect-manager) at **http://localhost:21465/manager/**: server profiles, session management and QR pairing, chat, contacts, groups and media, with Portuguese/English and light/dark themes.
27
+
28
+ Use `SECRET_KEY` for administration, or a session name/token for restricted access. Credentials remain in browser memory. Set `MANAGER_ENABLED=false` to disable serving the UI. The image pins and verifies the Manager bundle during build.
29
+
30
+ See [configuration, API, authenticated events and rollback](../docs/manager.md). Existing APIs and legacy sockets remain compatible. Live WhatsApp send/receive requires separate validation with an authorized account.
31
+
32
+ [![npm version](https://img.shields.io/npm/v/@wppconnect/server.svg?color=green)](https://www.npmjs.com/package/@wppconnect/server)
33
+ [![Downloads](https://img.shields.io/npm/dm/@wppconnect/server.svg)](https://www.npmjs.com/package/@wppconnect/server)
34
+ [![Docker Pulls](https://img.shields.io/docker/pulls/wppconnect/wppconnect-server?logo=docker)](https://hub.docker.com/r/wppconnect/wppconnect-server)
35
+ [![Docker Image Version](https://img.shields.io/docker/v/wppconnect/wppconnect-server?sort=semver&logo=docker)](https://hub.docker.com/r/wppconnect/wppconnect-server/tags)
36
+ [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wppconnect-team/wppconnect-server.svg)](https://isitmaintained.com/project/wppconnect-team/wppconnect-server 'Average time to resolve an issue')
37
+ [![Percentage of issues still open](https://isitmaintained.com/badge/open/wppconnect-team/wppconnect-server.svg)](https://isitmaintained.com/badge/open/wppconnect-team/wppconnect-server.svg 'Percentage of issues still open')
38
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wppconnect-server/build.yml)](https://github.com/wppconnect-team/wppconnect-server/actions)
39
+ [![Build](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml/badge.svg)](https://github.com/wppconnect-team/wppconnect-server/actions/workflows/build.yml)
40
+ [![release-it](https://img.shields.io/badge/%F0%9F%93%A6%F0%9F%9A%80-release--it-e10079.svg)](https://github.com/release-it/release-it)
41
+
42
+ 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.
43
+
44
+ - Javascript ES6
45
+ - NodeJS
46
+ - Restfull
47
+
48
+ ## Our online channels
49
+
50
+ Connect with us across various platforms to stay updated and engage in discussions:
51
+
52
+ [![Discord](https://img.shields.io/discord/844351092758413353?color=blueviolet&label=Discord&logo=discord&style=flat)](https://discord.gg/JU5JGGKGNG)
53
+ [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/wppconnect)
54
+ [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
55
+ [![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect)
56
+
57
+ ## Documentations
58
+
59
+ Detailed documentation and guides are available for your convenience:
60
+
61
+ - [Postman](https://documenter.getpostman.com/view/9139457/TzshF4jQ)
62
+ - [Swagger](https://wppconnect.io/swagger/wppconnect-server)
63
+ - Swagger UI can be accessed on your server through the route: "IP:PORT/api-docs"
64
+
65
+ ## Features
66
+
67
+ | | |
68
+ | ------------------------------------ | --- |
69
+ | Multiple Sessions | ✔ |
70
+ | Send **text, image, video and docs** | ✔ |
71
+ | Get **contacts list** | ✔ |
72
+ | Manage products | ✔ |
73
+ | Receive/Send messages | ✔ |
74
+ | Open/Close Session | ✔ |
75
+ | Change Profile/Username | ✔ |
76
+ | Create Group | ✔ |
77
+ | Join Group by Invite Code | ✔ |
78
+ | Webhook | ✔ |
79
+
80
+ ## Libraries Used
81
+
82
+ - WPPConnect
83
+ - Axios
84
+ - Bcrypt
85
+ - Cors
86
+ - Dotenv
87
+ - Express
88
+ - Nodemon
89
+ - SocketIO
90
+ - S3
91
+
92
+ ## Docker (recommended)
93
+
94
+ The official image is available on
95
+ [Docker Hub](https://hub.docker.com/r/wppconnect/wppconnect-server). It includes
96
+ Node.js, Chromium, and the native dependencies required by WPPConnect.
97
+
98
+ ```sh
99
+ docker run -d \
100
+ --name wppconnect-server \
101
+ --restart unless-stopped \
102
+ -p 21465:21465 \
103
+ -e SECRET_KEY=change-me \
104
+ -v wppconnect_tokens:/usr/src/wpp-server/tokens \
105
+ -v wppconnect_user_data:/usr/src/wpp-server/userDataDir \
106
+ wppconnect/wppconnect-server:latest
107
+ ```
108
+
109
+ For Docker Compose, clone the repository, copy the example and edit `SECRET_KEY`:
110
+
111
+ ```sh
112
+ cp .env.example .env
113
+ # Edit .env and replace SECRET_KEY. In PowerShell, use Copy-Item .env.example .env.
114
+ docker compose up -d
115
+ docker compose ps
116
+ curl http://localhost:21465/healthz
117
+ ```
118
+
119
+ Set `WPP_SERVER_TAG` to pin a release instead of following `latest`:
120
+
121
+ ```sh
122
+ WPP_SERVER_TAG=2.10.18 docker compose up -d
123
+ ```
124
+
125
+ Release tags follow the GitHub and npm version: `vX.Y.Z`, `X.Y.Z`, `X.Y`,
126
+ `X`, and `latest`. The `main`, `develop`, and immutable `sha-*` tags are also
127
+ available. See all tags on
128
+ [Docker Hub](https://hub.docker.com/r/wppconnect/wppconnect-server/tags).
129
+
130
+ The container accepts `PORT`, `HOST`, `SECRET_KEY`, `WEBHOOK_URL`,
131
+ `WEBHOOK_AUTO_DOWNLOAD_MAX_SIZE`, `TOKEN_STORE_TYPE`, `CUSTOM_USER_DATA_DIR`, `MAX_LISTENERS`, and the Redis and
132
+ MongoDB variables listed in the [Configuration](#configuration) section. The
133
+ Compose setup persists tokens, Chromium session data, uploads, received images,
134
+ and logs in named volumes. Change the default secret before exposing the API.
135
+
136
+ To upgrade the Compose deployment:
137
+
138
+ ```sh
139
+ docker compose pull
140
+ docker compose up -d
141
+ ```
142
+
143
+ ## Installation from source
144
+
145
+ Install the dependencies, copy `.env.example` to `.env`, and edit `SECRET_KEY`. Node loads `.env` from the directory where you start the server; existing environment variables take precedence. The file is optional.
146
+
147
+ ```sh
148
+ yarn install --immutable
149
+ cp .env.example .env
150
+ # PowerShell: Copy-Item .env.example .env
151
+ ```
152
+
153
+ ## Install puppeteer dependencies:
154
+
155
+ ```sh
156
+ 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
157
+
158
+ ```
159
+
160
+ ## Install google chrome
161
+
162
+ ```sh
163
+
164
+ wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
165
+
166
+ sudo apt-get update
167
+
168
+ sudo apt-get install libappindicator1
169
+
170
+ sudo dpkg -i google-chrome-stable_current_amd64.deb
171
+
172
+ ```
173
+
174
+ ### Troubleshooting
175
+ If you encounter installation issues, please try the procedures below
176
+ . Error Sharp Runtime
177
+ ```sh
178
+ yarn add sharp
179
+ npm install --include=optional sharp
180
+ //or
181
+ yarn add sharp --ignore-engines
182
+ ```
183
+
184
+ ## Run Server
185
+
186
+ ```sh
187
+ yarn dev
188
+ ```
189
+
190
+ ## Build Server
191
+
192
+ ```sh
193
+ yarn build
194
+ ```
195
+
196
+ ---
197
+
198
+ # Configuration
199
+
200
+ Configuration defaults remain in [src/config.ts](../src/config.ts). Supported environment variables are documented in [.env.example](../.env.example); the file is also included in the npm package.
201
+
202
+ The default configuration resolves values in this order: existing process environment, optional `.env` in the working directory, then built-in defaults. Restart the process or recreate the container after changing a value. Variables are read at runtime, so changing them does not require rebuilding the image.
203
+
204
+ | Area | Variables |
205
+ | --- | --- |
206
+ | Webhook delivery | `WEBHOOK_RETRY_ATTEMPTS` (total attempts, default 3, range 1-10), `WEBHOOK_RETRY_DELAY` (initial backoff in ms, default 5000, capped at 60000), `WEBHOOK_REQUEST_TIMEOUT` (ms per request, default 30000, range 1-120000) |
207
+ | Session webhook destinations | `WEBHOOK_ALLOWED_URLS` (comma-separated exact URLs; session-specific destinations must equal `WEBHOOK_URL` or an entry in this list) |
208
+ | Chatwoot destinations | `CHATWOOT_ALLOWED_URLS` (comma-separated exact base URLs the operator approves for session configuration) |
209
+ | Server | `SECRET_KEY`, `HOST`, `PORT`, `WEBHOOK_URL` |
210
+ | Webhook | `WEBHOOK_AUTO_DOWNLOAD_MAX_SIZE` (bytes; media larger than this is sent without inlined base64 and with `autoDownloadSkipped: true`, fetch it via `download-media`; `0` = no limit) |
211
+ | Sessions | `TOKEN_STORE_TYPE`, `CUSTOM_USER_DATA_DIR`, `MAX_LISTENERS` |
212
+ | Manager | `MANAGER_ENABLED`, `MANAGER_DIST` |
213
+ | Redis | `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`, `REDIS_DB`, `REDIS_PREFIX` |
214
+ | MongoDB | `MONGO_URL_REMOTE`, `MONGODB_DATABASE`, `MONGODB_COLLECTION`, `MONGODB_USER`, `MONGODB_PASSWORD`, `MONGODB_HOST`, `MONGODB_PORT` |
215
+ | Compose image | `WPP_SERVER_TAG` (used by Compose, not the Node server) |
216
+
217
+ Webhook delivery retries transient connection failures with exponential backoff
218
+ and the same event payload. HTTP error responses are not retried. The receiver
219
+ should deduplicate message events by session, event and message ID, because a
220
+ timeout or connection reset can happen after the receiver has processed a request.
221
+ Retries are held in memory and do not survive a server restart.
222
+
223
+ When using a session-specific webhook, configure its exact destination in
224
+ `WEBHOOK_ALLOWED_URLS` or `webhook.allowedUrls` first. An unlisted session URL
225
+ is rejected before making a network request. The global `WEBHOOK_URL` remains
226
+ the default destination and is also permitted as an explicit session selection.
227
+
228
+ Before starting a Chatwoot-enabled session, list its exact `chatWoot.baseURL`
229
+ in `CHATWOOT_ALLOWED_URLS` or `serverOptions.chatwoot.allowedUrls`. Self-hosted
230
+ and private-network destinations are supported when explicitly listed. Session
231
+ requests cannot add destinations. Use an HTTP or HTTPS URL without credentials,
232
+ query parameters or a fragment. Chatwoot requests do not follow redirects;
233
+ configure the final destination URL. Account, inbox, contact and conversation
234
+ identifiers must be numeric.
235
+
236
+ Session listing and backup now use `POST /api/show-all-sessions` and
237
+ `POST /api/backup-sessions`, respectively. Send the operator `SECRET_KEY` in
238
+ the `x-secret-key` header. The former GET URLs containing a secret return 410
239
+ and do not list sessions or create a backup. Update clients and remove old
240
+ secret-bearing URLs from bookmarks and scripts.
241
+
242
+ ```sh
243
+ curl -X POST -H "x-secret-key: $SECRET_KEY" http://localhost:21465/api/show-all-sessions
244
+ curl -X POST -H "x-secret-key: $SECRET_KEY" http://localhost:21465/api/backup-sessions -o sessions.zip
245
+ ```
246
+
247
+ For Node, both `yarn dev` and the compiled `yarn start` load the optional file automatically. For example, after setting `PORT=21470` in `.env`, the server listens on port 21470. `HOST` supplies the advertised URL; it does not restrict the listener address.
248
+
249
+ Compose reads `.env` for interpolation and explicitly forwards the supported server variables. Setting `PORT=21470` changes both the container listener and the published host port; setting `MANAGER_ENABLED=false` disables `/manager/` while the API remains available. You can select another file with `docker compose --env-file ./.env.production up -d`. Variables defined by the shell take precedence over values in the file.
250
+
251
+ For plain Docker, pass variables with `-e` or `--env-file`:
252
+
253
+ ```sh
254
+ docker run --rm --env-file .env -p 21465:21465 wppconnect/wppconnect-server:2.10.18
255
+ ```
256
+
257
+ If `PORT` differs from 21465, adjust both sides of `-p` accordingly. Use the persistent volumes shown in the Docker section for regular deployments. Private `.env` files are excluded from image builds and npm packages; `.env.example` remains available. Docker does not need a private file baked into the image.
258
+
259
+ Paths in containers refer to the container filesystem. Keep `CUSTOM_USER_DATA_DIR` inside the mounted session-data directory (and retain its trailing slash), or change the volume mapping too. `MANAGER_DIST` points to an existing static bundle; leaving it empty uses the default location. The official Docker image supplies that bundle.
260
+
261
+ Redis and MongoDB services must be provisioned separately; the included Compose file starts only WPPConnect. The default MongoDB remote mode uses `MONGO_URL_REMOTE`. Structured MongoDB host/user/port settings apply when `db.mongoIsRemote` is disabled in the advanced configuration.
262
+
263
+ Advanced options without an environment mapping, such as browser arguments and webhook event toggles, remain in `src/config.ts` or can be supplied to `initServer(...)` when embedding the server. Changing TypeScript configuration requires rebuilding the compiled server; environment-only changes do not.
264
+
265
+ # Secret Key
266
+
267
+ Set `SECRET_KEY` in `.env` or the deployment environment to a private, randomly generated value. The legacy default is retained for compatibility; replace it before exposing the API. Never commit your private `.env`.
268
+
269
+ <!-- ![Peek 2021-03-25 09-33](https://user-images.githubusercontent.com/40338524/112473515-3b310a80-8d4d-11eb-94bb-ff409c91d9b8.gif) -->
270
+
271
+ # Generate Token
272
+
273
+ To generate an access token, you must use your `SECRET_KEY`.
274
+
275
+ Using the route:
276
+
277
+ ```shell
278
+ curl -X POST --location "http://localhost:21465/api/mySession/THISISMYSECURETOKEN/generate-token"
279
+ ```
280
+
281
+ ### Response:
282
+
283
+ ```json
284
+ {
285
+ "status": "Success",
286
+ "session": "mySession",
287
+ "token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
288
+ "full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
289
+ }
290
+ ```
291
+
292
+ # Using Token
293
+
294
+ Save the value of the "full" response. Then use this value to call the routes.
295
+
296
+ # Examples
297
+
298
+ ```sh
299
+ #Starting Session
300
+ # /api/:session/start-session
301
+
302
+ curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
303
+ -H "Accept: application/json" \
304
+ -H "Content-Type: application/json" \
305
+ -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
306
+ ```
307
+
308
+ ```sh
309
+ #Get QrCode
310
+ # /api/:session/start-session
311
+ # when the session is starting if the method is called again it will return the base64 qrCode
312
+
313
+ curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
314
+ -H "Accept: application/json" \
315
+ -H "Content-Type: application/json" \
316
+ -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
317
+ ```
318
+
319
+ ```sh
320
+ #Send Message
321
+ # /api/:session/send-message
322
+ curl -X POST --location "http://localhost:21465/api/mySession/send-message" \
323
+ -H "Content-Type: application/json; charset=utf-8" \
324
+ -H "Accept: application/json" \
325
+ -H "Authorization: Bearer \$2b\$10\$8aQFQxnWREtBEMZK_iHMe.u7NeoNkjL7s6NYai_83Pb31Ycss6Igm" \
326
+ -d "{
327
+ \"phone\": \"5511900000000\",
328
+ \"message\": \"*Abner* Rodrigues\"
329
+ }"
330
+ ```
331
+
332
+ See the `routes` file for all the routes. [here](../src/routes/index.ts) and HTTP [file](../requests.http).
333
+
334
+ # Swagger UI
335
+
336
+ Swagger ui can be found at `/api-docs`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect/server",
3
- "version": "2.10.71",
3
+ "version": "2.10.73",
4
4
  "description": "Projeto feito para autenticar a automomacao do WhatsappWeb com multi-clientes de forma dinamica. Backend feito em Nodejs(express, socketio), FrontEnd (ReactJS)",
5
5
  "main": "dist/index.js",
6
6
  "author": "kingaspx",
@@ -128,7 +128,7 @@
128
128
  "@ungap/structured-clone": "1.4.0",
129
129
  "ajv@npm:^6.12.4": "6.15.0",
130
130
  "ajv@npm:^8.11.0": "8.18.0",
131
- "basic-ftp": "6.2.1",
131
+ "basic-ftp": "6.2.4",
132
132
  "brace-expansion@npm:^2.0.1": "2.1.7",
133
133
  "brace-expansion@npm:^5.0.2": "5.0.12",
134
134
  "defu": "6.1.7",