JSPM

whatsapp-web-x

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q9267F
  • License Apache-2.0

A student fork of whatsapp-web.js. Teaching module for interacting with the WhatsApp Web API.

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

Forks Stars Issues License


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.



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 stable

Choco

choco install nodejs-lts

Winget

winget install OpenJS.NodeJS.LTS

Ubuntu / Debian

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

Example 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:


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.