back to home

wppconnect-team / wa-js

WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web

View on GitHub
706 stars
211 forks
25 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing wppconnect-team/wa-js in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/wppconnect-team/wa-js)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

WPPConnect/WA-JS > WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases and many other things, use your imagination... Our online channels Top Contributors (last 45 days) widget --- --- Check also our Public Dashboard powered by devActivity How does it work This project extracts some functions of WhatsApp sources. After build, this project generates a file to be used for injection in WhatsApp Web. When injected, it will expose a global variable named . Some parts of variable: • - Scripts to export WhatsApp functions. • - Only exported WhatsApp functions. • - Chat functions and events. • ... Exported WhatsApp modules There are convention names for some exported modules: • - Class for data structure ( , ) • - Class for collection of models ( , ) • - Default and global instance of a collection ( , ) Some Available functions General Functions • Connect to WhatsApp Web • Check if the connection is authenticated • Logout from WhatsApp Web • Current WhatsApp build constants • Get current stream mode and info (connection state) For the most up-to-date list of available functions, launch the project locally and run this in your browser console: Chat Functions • Send a text message • Send a file message (medias in general [video, audio, image, pdf]) • Get chat details • Delete a message For the most up-to-date list of available functions, launch the project locally and run this in your browser console: Contact Functions • Get contact details • Get all contacts • Get status ( field in profile) • Get groups in common with one contact • Get PN (Phone Number), Lid and Contact from local cache For the most up-to-date list of available functions, launch the project locally and run this in your browser console: Blocklist Functions • Block a contact • Unblock a contact • All blocked contacts • Check if contact is blocked For the most up-to-date list of available functions, launch the project locally and run this in your browser console: Group Functions • Create a new group • Check if contact can be added to group • Add participants to a group • Remove participants from a group. • Check if contact can be promoted • Promote participants to admin • Check if contact can be demoted • Demote participants from admin. • Get group information from an invitation link or an invite code. • Get all groups For the most up-to-date list of available functions, launch the project locally and run this in your browser console: Events Connection Events • Triggered when the connection mode changes Stream modes: • - QR code is displayed, waiting for scan • - Main interface is loaded and ready • - Syncing messages and data • - Connection is offline • - Login conflict detected • - Blocked by proxy • - Blocked for Terms of Service violation • - SMB blocked for Terms of Service violation • - WhatsApp version is deprecated • Triggered when the internal connection state changes Stream info states: • - Connection is offline • - Opening connection • - Pairing with phone • - Syncing messages • - Resuming connection • - Connecting to server • - Normal operation Chat Events • Event to dispatch on receive a new message To see all events, check: https://wppconnect.io/wa-js/types/ev.EventTypes.html Development Steps to run locally: Note: to run specific versions run: To debug or inspect folder, format the files to be easier to understand Comparing WhatsApp Web Versions To compare changes between two WhatsApp Web versions, use the helper script: Note: You need to run locally in multiple versions to download the scripts to wa-source folder, otherwise will not have anything to compare. To do it use: This is useful for: • Tracking API changes between WhatsApp Web updates • Identifying when function signatures changed • Finding new or removed modules How to use this project Basically, you need to inject the file into the browser after WhatsApp page load. TamperMonkey or GreaseMonkey Playwright License Copyright 2021 WPPConnect Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 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.