{"id":14986969,"url":"https://github.com/wppconnect-team/wa-js","last_synced_at":"2026-05-15T01:15:26.826Z","repository":{"id":36963676,"uuid":"398082606","full_name":"wppconnect-team/wa-js","owner":"wppconnect-team","description":"WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web","archived":false,"fork":false,"pushed_at":"2026-04-29T22:28:27.000Z","size":320039,"stargazers_count":724,"open_issues_count":23,"forks_count":218,"subscribers_count":34,"default_branch":"main","last_synced_at":"2026-04-30T00:35:53.938Z","etag":null,"topics":["wa","wajs","whatsapp","whatsapp-api","whatsapp-bot","whatsapp-chatbot","whatsapp-integration","whatsapp-sdk","whatsapp-web","whatsapp-web-api","whatsapp-web-automation","wpp"],"latest_commit_sha":null,"homepage":"https://wppconnect.io/wa-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wppconnect-team.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["icleitoncosta","joaosouz4dev"],"open_collective":"wppconnect"}},"created_at":"2021-08-19T21:48:37.000Z","updated_at":"2026-04-29T22:26:44.000Z","dependencies_parsed_at":"2024-05-16T06:55:25.570Z","dependency_job_id":"48f36d0f-83f4-408e-abad-d468974504aa","html_url":"https://github.com/wppconnect-team/wa-js","commit_stats":{"total_commits":2989,"total_committers":27,"mean_commits":"110.70370370370371","dds":0.4670458347273335,"last_synced_commit":"87953a33e8a162ef33474045593960829ac47c3c"},"previous_names":[],"tags_count":215,"template":false,"template_full_name":null,"purl":"pkg:github/wppconnect-team/wa-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppconnect-team%2Fwa-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppconnect-team%2Fwa-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppconnect-team%2Fwa-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppconnect-team%2Fwa-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wppconnect-team","download_url":"https://codeload.github.com/wppconnect-team/wa-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppconnect-team%2Fwa-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32626544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wa","wajs","whatsapp","whatsapp-api","whatsapp-bot","whatsapp-chatbot","whatsapp-integration","whatsapp-sdk","whatsapp-web","whatsapp-web-api","whatsapp-web-automation","wpp"],"created_at":"2024-09-24T14:13:53.574Z","updated_at":"2026-05-04T22:06:36.639Z","avatar_url":"https://github.com/wppconnect-team.png","language":"TypeScript","funding_links":["https://github.com/sponsors/icleitoncosta","https://github.com/sponsors/joaosouz4dev","https://opencollective.com/wppconnect"],"categories":["TypeScript"],"sub_categories":[],"readme":"# WPPConnect/WA-JS\n\n[![npm version](https://img.shields.io/npm/v/@wppconnect/wa-js.svg?color=green)](https://www.npmjs.com/package/@wppconnect/wa-js)\n[![Downloads](https://img.shields.io/npm/dm/@wppconnect/wa-js.svg)](https://www.npmjs.com/package/@wppconnect/wa-js)\n[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wppconnect-team/wa-js.svg)](https://isitmaintained.com/project/wppconnect-team/wa-js 'Average time to resolve an issue')\n[![Percentage of issues still open](https://isitmaintained.com/badge/open/wppconnect-team/wa-js.svg)](https://isitmaintained.com/project/wppconnect-team/wa-js 'Percentage of issues still open')\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wa-js/build.yml?branch=main)](https://github.com/wppconnect-team/wa-js/actions/workflows/build.yml)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wa-js/test.yml?branch=main)](https://github.com/wppconnect-team/wa-js/actions/workflows/test.yml)\n[![Lint Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wa-js/lint.yml??branch=main\u0026label=lint)](https://github.com/wppconnect-team/wa-js/actions/workflows/lint.yml)\n[![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)\n\n\u003e 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...\n\n## Our online channels\n\n[![Discussions](https://img.shields.io/github/discussions/wppconnect-team/wa-js?label=Discussions\u0026logo=github)](https://github.com/wppconnect-team/wa-js/discussions)\n[![Discord](https://img.shields.io/discord/844351092758413353?color=blueviolet\u0026label=Discord\u0026logo=discord\u0026style=flat)](https://discord.gg/JU5JGGKGNG)\n[![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect)\n[![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)\n[![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/wppconnect)\n\n\n### Top Contributors (last 45 days) widget\n---\n![Top Contributors (Last 45 days) widget](https://embeddables.devactivity.com/orgs/wppconnect-team/508ecbcd-e55e-4e31-a647-6674f134b5bf.svg)\n---\n\u003csup\u003e\u003csub\u003eCheck also our [Public Dashboard](https://app.devactivity.com/public/?organizationLogin=wppconnect-team) powered by [devActivity](https://devactivity.com/?ref=public_widget)\u003c/sub\u003e\u003c/sup\u003e\n\n## How does it work\n\nThis project extracts some functions of WhatsApp sources.\n\nAfter build, this project generates a file `dist/wppconnect-wa.js` to be used for injection in WhatsApp Web. When injected, it will expose a global variable named `WPP`.\n\nSome parts of `WPP` variable:\n\n- `WPP.loader` - Scripts to export WhatsApp functions.\n- `WPP.whatsapp` - Only exported WhatsApp functions.\n- `WPP.chat` - Chat functions and events.\n- ...\n\n## Exported WhatsApp modules\n\nThere are convention names for some exported modules:\n\n- `...Model` - Class for data structure (`ClassModel`, `MsgModel`)\n- `...Collection` - Class for collection of models (`ChatCollection`, `MsgCollection`)\n- `...Store` - Default and global instance of a collection (`ChatStore`, `MsgStore`)\n\n## Some Available functions\n### General Functions\n`WPP.conn.connect` - Connect to WhatsApp Web\n\n`WPP.conn.isAuthenticated` - Check if the connection is authenticated\n\n`WPP.conn.logout` - Logout from WhatsApp Web\n\n`WPP.conn.getBuildConstants` - Current WhatsApp build constants\n\n`WPP.conn.getStreamData` - Get current stream mode and info (connection state)\n\nFor the most up-to-date list of available functions, launch the project locally and run this in your browser console:\n\n`Object.keys(WPP.conn).sort()`\n\n### Chat Functions\n`WPP.chat.sendTextMessage` - Send a text message\n\n`WPP.chat.sendFileMessage` - Send a file message (medias in general [video, audio, image, pdf])\n\n`WPP.chat.get` - Get chat details\n\n`WPP.chat.deleteMessage` - Delete a message\n\nFor the most up-to-date list of available functions, launch the project locally and run this in your browser console:\n\n`Object.keys(WPP.chat).sort()`\n\n### Contact Functions\n`WPP.contact.get` - Get contact details\n\n`WPP.contact.getAllContacts` - Get all contacts\n\n`WPP.contact.getStatus` - Get status (`about` field in profile)\n\n`WPP.contact.getCommonGroups` - Get groups in common with one contact\n\n`WPP.contact.getPnLidEntry` - Get PN (Phone Number), Lid and Contact from local cache\n\nFor the most up-to-date list of available functions, launch the project locally and run this in your browser console:\n\n`Object.keys(WPP.contact).sort()`\n\n### Blocklist Functions\n\n`WPP.blocklist.blockContact` - Block a contact\n\n`WPP.blocklist.unblockContact` - Unblock a contact\n\n`WPP.blocklist.all` - All blocked contacts\n\n`WPP.blocklist.isBlocked` - Check if contact is blocked\n\nFor the most up-to-date list of available functions, launch the project locally and run this in your browser console:\n\n`Object.keys(WPP.blocklist).sort()`\n\n### Group Functions\n\n`WPP.group.create` - Create a new group\n\n`WPP.group.canAdd` - Check if contact can be added to group\n\n`WPP.group.addParticipants` - Add participants to a group\n\n`WPP.group.removeParticipants` - Remove participants from a group.\n\n`WPP.group.canPromote` - Check if contact can be promoted\n\n`WPP.group.promoteParticipants` - Promote participants to admin\n\n`WPP.group.canDemote` - Check if contact can be demoted\n\n`WPP.group.demoteParticipants` - Demote participants from admin.\n\n`WPP.group.getGroupInfoFromInviteCode` - Get group information from an invitation link or an invite code.\n\n`WPP.group.getAllGroups` - Get all groups\n\nFor the most up-to-date list of available functions, launch the project locally and run this in your browser console:\n\n`Object.keys(WPP.group).sort()`\n\n### Events\n\n#### Connection Events\n\n`WPP.on('conn.stream_mode_changed', callback)` - Triggered when the connection mode changes\n\nStream modes:\n- `QR` - QR code is displayed, waiting for scan\n- `MAIN` - Main interface is loaded and ready\n- `SYNCING` - Syncing messages and data\n- `OFFLINE` - Connection is offline\n- `CONFLICT` - Login conflict detected\n- `PROXYBLOCK` - Blocked by proxy\n- `TOS_BLOCK` - Blocked for Terms of Service violation\n- `SMB_TOS_BLOCK` - SMB blocked for Terms of Service violation\n- `DEPRECATED_VERSION` - WhatsApp version is deprecated\n\n```javascript\nWPP.on('conn.stream_mode_changed', (mode) =\u003e {\n  console.log('Connection mode:', mode);\n  if (mode === 'MAIN') {\n    console.log('WhatsApp is ready!');\n  }\n});\n```\n\n`WPP.on('conn.stream_info_changed', callback)` - Triggered when the internal connection state changes\n\nStream info states:\n- `OFFLINE` - Connection is offline\n- `OPENING` - Opening connection\n- `PAIRING` - Pairing with phone\n- `SYNCING` - Syncing messages\n- `RESUMING` - Resuming connection\n- `CONNECTING` - Connecting to server\n- `NORMAL` - Normal operation\n\n```javascript\nWPP.on('conn.stream_info_changed', (info) =\u003e {\n  console.log('Connection state:', info);\n});\n```\n\n#### Chat Events\n\n`WPP.chat.on('chat.new_message')` - Event to dispatch on receive a new message\n\nTo see all events, check: [https://wppconnect.io/wa-js/types/ev.EventTypes.html](https://wppconnect.io/wa-js/types/ev.EventTypes.html)\n\n## Development\n\nSteps to run locally:\n\n```bash\n# install the dependencies\nnpm install\n\n# build javascript files\nnpm run build:prd # or build:dev for development\n\n# launch a local browser with automatic injection\n# this will also cache the files inside wa-source directory, for next requests\nnpm run launch:local\n\n# or only run in VSCode\n```\n\nNote: to run specific versions run:\n\n```sh\nnpm run wa-source:clean\n\nnpm run build:prd\n\nWA_VERSION=\"2.3000.1029560485\" npm run launch:local\n```\n\nTo debug or inspect `wa-source` folder, format the files to be easier to understand\n\n```sh\nnpm run wa-source:format\n```\n\n### Comparing WhatsApp Web Versions\n\nTo compare changes between two WhatsApp Web versions, use the helper script:\n\nNote: 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: `WA_VERSION=\"\u003cversion-here\u003e\" npm run launch:local`\n\n```bash\n# Compare two versions (overview of module differences)\n./scripts/compare-wa-versions.sh 2.3000.1031980585 2.3000.1031992593\n\n# Compare a specific module between versions\n./scripts/compare-wa-versions.sh 2.3000.1031980585 2.3000.1031992593 WAWebUpdateUnreadChatAction\n\n# List available versions\n./scripts/compare-wa-versions.sh\n```\n\nThis is useful for:\n- Tracking API changes between WhatsApp Web updates\n- Identifying when function signatures changed\n- Finding new or removed modules\n\n## How to use this project\n\nBasically, you need to inject the `wppconnect-wa.js` file into the browser after WhatsApp page load.\n\n### TamperMonkey or GreaseMonkey\n\n```javascript\n// ==UserScript==\n// @name         WA-JS Teste\n// @namespace    http://tampermonkey.net/\n// @version      0.1\n// @description  Simple example of WA-JS\n// @author       You\n// @match        https://web.whatsapp.com/*\n// @icon         https://www.google.com/s2/favicons?domain=whatsapp.com\n// @require      https://github.com/wppconnect-team/wa-js/releases/download/nightly/wppconnect-wa.js\n// @grant        none\n// ==/UserScript==\n\n/* globals WPP */\n\n(function () {\n  'use strict';\n\n  WPP.loader.onReady(function () {\n    alert('Ready to use WPPConnect WA-JS');\n  });\n\n  // Your code here...\n})();\n```\n\n### Playwright\n\n```typescript\nimport * as playwright from 'playwright-chromium';\n\nasync function start() {\n  const browser = await playwright.chromium.launch();\n  const page = await browser.newPage();\n\n  await page.goto('https://web.whatsapp.com/');\n\n  await page.addScriptTag({\n    path: require.resolve('@wppconnect/wa-js'),\n  });\n\n  // Wait WA-JS load\n  await page.waitForFunction(() =\u003e window.WPP?.isReady);\n\n  // Evaluating code: See https://playwright.dev/docs/evaluating/\n  const isAuthenticated: string = await page.evaluate(() =\u003e\n    WPP.conn.isAuthenticated()\n  );\n\n  // Sending message: See https://playwright.dev/docs/evaluating/\n  const sendResult: string = await page.evaluate(\n    (to, message) =\u003e WPP.chat.sendTextMessage(to, message),\n    to,\n    message\n  );\n}\n\nstart();\n```\n\n## License\n\nCopyright 2021 WPPConnect Team\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwppconnect-team%2Fwa-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwppconnect-team%2Fwa-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwppconnect-team%2Fwa-js/lists"}