@wppconnect/server 2.10.72 → 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,5 @@
1
+ ## [2.10.73](https://github.com/wppconnect-team/wppconnect-server/compare/v2.10.72...v2.10.73) (2026-10-31)
2
+
1
3
  ## [2.10.72](https://github.com/wppconnect-team/wppconnect-server/compare/v2.10.71...v2.10.72) (2026-10-31)
2
4
 
3
5
  ## [2.10.71](https://github.com/wppconnect-team/wppconnect-server/compare/v2.10.70...v2.10.71) (2026-10-30)
package/README.md CHANGED
@@ -1,328 +1,113 @@
1
- <!-- wppconnect-official-brand -->
1
+ **English** | [Português (Brasil)](./README.pt-BR.md)
2
+
2
3
  <p align="center">
3
- <a href="https://wppconnect-team.github.io/">
4
+ <a href="https://wppconnect.io/">
4
5
  <picture>
5
6
  <source media="(prefers-color-scheme: dark)" srcset="https://wppconnect-team.github.io/brand/wppconnect-dark.png" />
6
7
  <img src="https://wppconnect-team.github.io/brand/wppconnect-light.png" alt="WPPConnect" width="220" height="121" />
7
8
  </picture>
8
9
  </a>
9
10
  </p>
10
- <!-- /wppconnect-official-brand -->
11
-
12
- # WPPConnect Team
13
-
14
- ## _WPPConnect Server_
15
-
16
- ### WPPConnect Manager
17
-
18
- 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.
19
-
20
- 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.
21
-
22
- 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.
23
-
24
- [![npm version](https://img.shields.io/npm/v/@wppconnect/server.svg?color=green)](https://www.npmjs.com/package/@wppconnect/server)
25
- [![Downloads](https://img.shields.io/npm/dm/@wppconnect/server.svg)](https://www.npmjs.com/package/@wppconnect/server)
26
- [![Docker Pulls](https://img.shields.io/docker/pulls/wppconnect/wppconnect-server?logo=docker)](https://hub.docker.com/r/wppconnect/wppconnect-server)
27
- [![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)
28
- [![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')
29
- [![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')
30
- [![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wppconnect-server/build.yml)](https://github.com/wppconnect-team/wppconnect-server/actions)
31
- [![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)
32
- [![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)
33
11
 
34
- 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.
12
+ # WPPConnect Server
35
13
 
36
- - Javascript ES6
37
- - NodeJS
38
- - Restfull
14
+ Run a REST API for WhatsApp sessions, messages and webhooks.
39
15
 
40
- ## Our online channels
16
+ A project in the WPPConnect ecosystem, maintained by WPPConnect Team.
41
17
 
42
- Connect with us across various platforms to stay updated and engage in discussions:
18
+ [Getting started](#getting-started) | [Documentation](#documentation) | [Contributing](#contributing) | [Support WPPConnect](#support-the-project)
43
19
 
44
- [![Discord](https://img.shields.io/discord/844351092758413353?color=blueviolet&label=Discord&logo=discord&style=flat)](https://discord.gg/JU5JGGKGNG)
45
- [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/wppconnect)
46
- [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
47
- [![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect)
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)
48
21
 
49
- ## Documentations
22
+ ## Overview
50
23
 
51
- Detailed documentation and guides are available for your convenience:
52
-
53
- - [Postman](https://documenter.getpostman.com/view/9139457/TzshF4jQ)
54
- - [Swagger](https://wppconnect.io/swagger/wppconnect-server)
55
- - 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.
56
25
 
57
26
  ## Features
58
27
 
59
- | | |
60
- | ------------------------------------ | --- |
61
- | Multiple Sessions | ✔ |
62
- | Send **text, image, video and docs** | ✔ |
63
- | Get **contacts list** | ✔ |
64
- | Manage products | ✔ |
65
- | Receive/Send messages | ✔ |
66
- | Open/Close Session | ✔ |
67
- | Change Profile/Username | ✔ |
68
- | Create Group | ✔ |
69
- | Join Group by Invite Code | ✔ |
70
- | Webhook | ✔ |
71
-
72
- ## Libraries Used
73
-
74
- - WPPConnect
75
- - Axios
76
- - Bcrypt
77
- - Cors
78
- - Dotenv
79
- - Express
80
- - Nodemon
81
- - SocketIO
82
- - S3
83
-
84
- ## Docker (recommended)
85
-
86
- The official image is available on
87
- [Docker Hub](https://hub.docker.com/r/wppconnect/wppconnect-server). It includes
88
- 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.
89
31
 
90
- ```sh
91
- docker run -d \
92
- --name wppconnect-server \
93
- --restart unless-stopped \
94
- -p 21465:21465 \
95
- -e SECRET_KEY=change-me \
96
- -v wppconnect_tokens:/usr/src/wpp-server/tokens \
97
- -v wppconnect_user_data:/usr/src/wpp-server/userDataDir \
98
- wppconnect/wppconnect-server:latest
99
- ```
32
+ ## Getting started
100
33
 
101
- 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:
102
35
 
103
36
  ```sh
104
37
  cp .env.example .env
105
- # Edit .env and replace SECRET_KEY. In PowerShell, use Copy-Item .env.example .env.
106
- docker compose up -d
107
- docker compose ps
108
- curl http://localhost:21465/healthz
109
- ```
110
-
111
- Set `WPP_SERVER_TAG` to pin a release instead of following `latest`:
112
-
113
- ```sh
114
- WPP_SERVER_TAG=2.10.18 docker compose up -d
115
38
  ```
116
39
 
117
- Release tags follow the GitHub and npm version: `vX.Y.Z`, `X.Y.Z`, `X.Y`,
118
- `X`, and `latest`. The `main`, `develop`, and immutable `sha-*` tags are also
119
- available. See all tags on
120
- [Docker Hub](https://hub.docker.com/r/wppconnect/wppconnect-server/tags).
121
-
122
- The container accepts `PORT`, `HOST`, `SECRET_KEY`, `WEBHOOK_URL`,
123
- `WEBHOOK_AUTO_DOWNLOAD_MAX_SIZE`, `TOKEN_STORE_TYPE`, `CUSTOM_USER_DATA_DIR`, `MAX_LISTENERS`, and the Redis and
124
- MongoDB variables listed in the [Configuration](#configuration) section. The
125
- Compose setup persists tokens, Chromium session data, uploads, received images,
126
- and logs in named volumes. Change the default secret before exposing the API.
127
-
128
- To upgrade the Compose deployment:
40
+ In PowerShell use `Copy-Item .env.example .env`. Edit `.env` and set a private random `SECRET_KEY` before starting.
129
41
 
130
42
  ```sh
131
- docker compose pull
132
43
  docker compose up -d
44
+ docker compose ps
45
+ curl -fsS http://localhost:21465/healthz
133
46
  ```
134
47
 
135
- ## 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`.
136
49
 
137
- 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.
138
-
139
- ```sh
140
- yarn install --immutable
141
- cp .env.example .env
142
- # PowerShell: Copy-Item .env.example .env
143
- ```
50
+ ## Configuration
144
51
 
145
- ## Install puppeteer dependencies:
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.
146
53
 
147
- ```sh
148
- 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
54
+ ## Documentation
149
55
 
150
- ```
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)
151
61
 
152
- ## Install google chrome
62
+ ## WPPConnect ecosystem
153
63
 
154
- ```sh
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. |
155
70
 
156
- wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
71
+ ## Support the project
157
72
 
158
- sudo apt-get update
73
+ WPPConnect is maintained by an open-source community. Your support helps fund maintenance, infrastructure, documentation, and the people working on the ecosystem.
159
74
 
160
- sudo apt-get install libappindicator1
75
+ If WPPConnect helps your project or business, consider making a one-time contribution or becoming a recurring supporter.
161
76
 
162
- sudo dpkg -i google-chrome-stable_current_amd64.deb
77
+ **[Support WPPConnect on Open Collective](https://opencollective.com/wppconnect)**
163
78
 
164
- ```
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.
165
80
 
166
- ### Troubleshooting
167
- If you encounter installation issues, please try the procedures below
168
- . Error Sharp Runtime
169
- ```sh
170
- yarn add sharp
171
- npm install --include=optional sharp
172
- //or
173
- yarn add sharp --ignore-engines
174
- ```
81
+ Additional official beneficiaries in [.github/FUNDING.yml](.github/FUNDING.yml): [joaosouz4dev](https://github.com/sponsors/joaosouz4dev), [manfe](https://github.com/sponsors/manfe).
175
82
 
176
- ## Run Server
83
+ ## Contributing
177
84
 
178
- ```sh
179
- yarn dev
180
- ```
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.
181
86
 
182
- ## Build Server
87
+ After installing the development dependencies, use the repository checks relevant to your change:
183
88
 
184
89
  ```sh
185
90
  yarn build
91
+ yarn lint
92
+ yarn test
186
93
  ```
187
94
 
188
- ---
189
-
190
- # Configuration
191
-
192
- 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.
193
-
194
- 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.
195
-
196
- | Area | Variables |
197
- | --- | --- |
198
- | 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) |
199
- | Session webhook destinations | `WEBHOOK_ALLOWED_URLS` (comma-separated exact URLs; session-specific destinations must equal `WEBHOOK_URL` or an entry in this list) |
200
- | Chatwoot destinations | `CHATWOOT_ALLOWED_URLS` (comma-separated exact base URLs the operator approves for session configuration) |
201
- | Server | `SECRET_KEY`, `HOST`, `PORT`, `WEBHOOK_URL` |
202
- | 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) |
203
- | Sessions | `TOKEN_STORE_TYPE`, `CUSTOM_USER_DATA_DIR`, `MAX_LISTENERS` |
204
- | Manager | `MANAGER_ENABLED`, `MANAGER_DIST` |
205
- | Redis | `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`, `REDIS_DB`, `REDIS_PREFIX` |
206
- | MongoDB | `MONGO_URL_REMOTE`, `MONGODB_DATABASE`, `MONGODB_COLLECTION`, `MONGODB_USER`, `MONGODB_PASSWORD`, `MONGODB_HOST`, `MONGODB_PORT` |
207
- | Compose image | `WPP_SERVER_TAG` (used by Compose, not the Node server) |
208
-
209
- Webhook delivery retries transient connection failures with exponential backoff
210
- and the same event payload. HTTP error responses are not retried. The receiver
211
- should deduplicate message events by session, event and message ID, because a
212
- timeout or connection reset can happen after the receiver has processed a request.
213
- Retries are held in memory and do not survive a server restart.
214
-
215
- When using a session-specific webhook, configure its exact destination in
216
- `WEBHOOK_ALLOWED_URLS` or `webhook.allowedUrls` first. An unlisted session URL
217
- is rejected before making a network request. The global `WEBHOOK_URL` remains
218
- the default destination and is also permitted as an explicit session selection.
219
-
220
- Before starting a Chatwoot-enabled session, list its exact `chatWoot.baseURL`
221
- in `CHATWOOT_ALLOWED_URLS` or `serverOptions.chatwoot.allowedUrls`. Self-hosted
222
- and private-network destinations are supported when explicitly listed. Session
223
- requests cannot add destinations. Use an HTTP or HTTPS URL without credentials,
224
- query parameters or a fragment. Chatwoot requests do not follow redirects;
225
- configure the final destination URL. Account, inbox, contact and conversation
226
- identifiers must be numeric.
227
-
228
- Session listing and backup now use `POST /api/show-all-sessions` and
229
- `POST /api/backup-sessions`, respectively. Send the operator `SECRET_KEY` in
230
- the `x-secret-key` header. The former GET URLs containing a secret return 410
231
- and do not list sessions or create a backup. Update clients and remove old
232
- secret-bearing URLs from bookmarks and scripts.
95
+ Account-dependent examples and tests require separate validation with an authorized test account. Never attach credentials or session files to an issue.
233
96
 
234
- ```sh
235
- curl -X POST -H "x-secret-key: $SECRET_KEY" http://localhost:21465/api/show-all-sessions
236
- curl -X POST -H "x-secret-key: $SECRET_KEY" http://localhost:21465/api/backup-sessions -o sessions.zip
237
- ```
238
-
239
- 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.
240
-
241
- 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.
242
-
243
- For plain Docker, pass variables with `-e` or `--env-file`:
244
-
245
- ```sh
246
- docker run --rm --env-file .env -p 21465:21465 wppconnect/wppconnect-server:2.10.18
247
- ```
248
-
249
- 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.
250
-
251
- 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.
252
-
253
- 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.
254
-
255
- 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.
256
-
257
- # Secret Key
258
-
259
- 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`.
260
-
261
- <!-- ![Peek 2021-03-25 09-33](https://user-images.githubusercontent.com/40338524/112473515-3b310a80-8d4d-11eb-94bb-ff409c91d9b8.gif) -->
262
-
263
- # Generate Token
97
+ ## Community and support
264
98
 
265
- To generate an access token, you must use your `SECRET_KEY`.
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:
266
100
 
267
- Using the route:
101
+ - [Discord](https://discord.gg/JU5JGGKGNG)
102
+ - [Telegram](https://t.me/wppconnect)
103
+ - [YouTube](https://www.youtube.com/c/wppconnect)
268
104
 
269
- ```shell
270
- curl -X POST --location "http://localhost:21465/api/mySession/THISISMYSECURETOKEN/generate-token"
271
- ```
272
-
273
- ### Response:
274
-
275
- ```json
276
- {
277
- "status": "Success",
278
- "session": "mySession",
279
- "token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
280
- "full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
281
- }
282
- ```
283
-
284
- # Using Token
285
-
286
- Save the value of the "full" response. Then use this value to call the routes.
287
-
288
- # Examples
289
-
290
- ```sh
291
- #Starting Session
292
- # /api/:session/start-session
293
-
294
- curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
295
- -H "Accept: application/json" \
296
- -H "Content-Type: application/json" \
297
- -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
298
- ```
299
-
300
- ```sh
301
- #Get QrCode
302
- # /api/:session/start-session
303
- # when the session is starting if the method is called again it will return the base64 qrCode
304
-
305
- curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
306
- -H "Accept: application/json" \
307
- -H "Content-Type: application/json" \
308
- -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
309
- ```
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.
310
106
 
311
- ```sh
312
- #Send Message
313
- # /api/:session/send-message
314
- curl -X POST --location "http://localhost:21465/api/mySession/send-message" \
315
- -H "Content-Type: application/json; charset=utf-8" \
316
- -H "Accept: application/json" \
317
- -H "Authorization: Bearer \$2b\$10\$8aQFQxnWREtBEMZK_iHMe.u7NeoNkjL7s6NYai_83Pb31Ycss6Igm" \
318
- -d "{
319
- \"phone\": \"5511900000000\",
320
- \"message\": \"*Abner* Rodrigues\"
321
- }"
322
- ```
107
+ ## License
323
108
 
324
- 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).
325
110
 
326
- # Swagger UI
111
+ Copyright 2021 WPPConnect Team.
327
112
 
328
- 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.72",
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",