Package Exports
- whatsapp-web-x
- whatsapp-web-x/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (whatsapp-web-x) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π± whatsappweb-x.js
by Pease Ernest Β· under Ernest Tech House
A modified version of WhatsApp Web.js with extended features & detailed logging
NOTE
This library has a significant number of console.log statements that are integral to its function as a teaching tool and therefore cannot be removed. It is designed for educational purposes only, and you should use the official library to build production bots.
π οΈ Contributions & Support
This library uses the exact same functions as the official whatsapp-web.js library, ensuring that all functionalities will work as expected. If you encounter any errors, please open an issue. If you believe you can contribute, you are welcome to fork the repository and submit a pull request. While it will be carefully reviewed, please note that changes that do not align with the educational purpose of this fork will not be accepted.
π The WhatsApp-Web.js Educational Fork
TL;DR
This is a teaching fork of whatsapp-web.js.
We added console.log statements inside the core library so you can watch how data flows in and out, making it easier to understand how Node.js libraries actually work.
About
Welcome to the WhatsApp-Web.js Educational Fork!
This is a modified version of the official whatsapp-web.js library, meticulously crafted to help aspiring developers understand how a Node.js library works behind the scenes.
Our primary focus is on teaching students what the library expects as input and what it produces as a result.
To achieve this, we have strategically placed console.log statements directly within the library's core functions.
This means you will see a detailed log of data flowing through the library as you interact with itβall without needing to add any logging code to your own project!
This is a learning tool, and in no way have we modified the code to do unauthorized activities or enabled any form of misuse of the library.
Who We Are
This educational fork was proudly modded by Ernest Tech House and coded by Pease Ernest.
A WhatsApp API client that connects through the WhatsApp Web browser app
The library works by launching the WhatsApp Web browser application and managing it using Puppeteer to create an instance of WhatsApp Web, thereby mitigating the risk of being blocked.
The WhatsApp API client connects through the WhatsApp Web browser app, accessing its internal functions.
This grants you access to nearly all the features available on WhatsApp Web, enabling dynamic handling similar to any other Node.js application.
[!IMPORTANT]
It is not guaranteed you will not be blocked by using this method. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
Links
Installation
The module is now available on npm!
π¦ Installation
npm install whatsappweb-x.j
> \[!NOTE]
> **Node `v18+` is required.**
---
## QUICK STEPS TO UPGRADE NODE
### Windows
#### Manual
Get the latest LTS from the [official Node.js website](https://nodejs.org/en/download/).
#### npm
```powershell
sudo npm install -g n
sudo n stableChoco
choco install nodejs-ltsWinget
winget install OpenJS.NodeJS.LTSUbuntu / Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
sudo apt-get install -y nodejsExample usage
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => {
// Generate and scan this code with your phone
console.log('QR RECEIVED', qr);
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.on('message', msg => {
if (msg.body == '!ping') {
msg.reply('pong');
}
});
client.initialize();See example.js for more use cases. For further details on saving and restoring sessions, check out the Authentication Strategies.
Supported features
| Feature | Status | Why this is a great feature to study |
|---|---|---|
| Multi Device | β | Learn how a single bot can manage multiple simultaneous connections. |
| Send messages | β | Understand how a string of text is packaged and sent to an endpoint. |
| Receive messages | β | See the full message object data you receive, from the body to the sender's ID. |
| Send media (images/audio/documents) | β | Explore how media files are handled and uploaded. |
| Send media (video) | β (requires Google Chrome) | Learn about browser dependencies and specific video handling. |
| Send stickers | β | See how custom content is converted into a WhatsApp-supported format. |
| Receive media (images/audio/video/documents) | β | Witness how incoming media is processed and converted into usable data. |
| Send contact cards | β | Discover how to handle complex data types like contact information. |
| Send location | β | Study how geospatial coordinates are formatted and sent. |
| Send buttons | β (DEPRECATED) | A great example of a feature being phased out and how a library manages it. |
| Send lists | β (DEPRECATED) | Another opportunity to see how deprecation is handled. |
| Receive location | β | Observe how incoming location data is parsed. |
| Message replies | β | Learn the mechanics of replying to a specific message thread. |
| Join groups by invite | β | See how an invite link is converted to a group ID. |
| Get invite for group | β | Study the process of generating and retrieving a new invite link. |
| Modify group info (subject, description) | β | Understand how metadata changes are sent and received. |
| Modify group settings (send messages, edit info) | β | Learn how permissions and group settings are toggled programmatically. |
| Add group participants | β | Witness how participant IDs are added to a group. |
| Kick group participants | β | See how participants are removed from a group. |
| Promote/demote group participants | β | Study the process of changing a user's role. |
| Mention users | β | Learn how to tag specific users in a message. |
| Mention groups | β | Observe how an entire group can be mentioned. |
| Mute/unmute chats | β | See how chat notifications are controlled. |
| Block/unblock contacts | β | A key feature for understanding contact management. |
| Get contact info | β | Explore how contact data is retrieved. |
| Get profile pictures | β | Learn how image data is fetched. |
| Set user status message | β | Understand how user profiles are updated. |
| React to messages | β | See how emoji reactions are handled. |
| Create polls | β | The perfect example for understanding how complex objects are created and sent. |
| Channels | β | A new feature to learn from. |
| Vote in polls | π | Stay tuned! |
| Communities | π | Stay tuned! |
Contributing
As this is a carefully crafted educational library, we are not accepting any further modifications at this time. However, if you find a bug or a typo in our learning-focused code, please feel free to open an issue!
Supporting the project
You can support Ernest Tech House through the links below:
- GitHub Sponsors
- PayPal (replace with your PayPal if you want direct support)
- DigitalOcean Referral β get $200 credit when you sign up
Disclaimer
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or affiliates. The official WhatsApp website can be found at whatsapp.com.
"WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
Also it is not guaranteed you will not be blocked by using this method. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
License
Copyright 2025 Pease Ernest
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.