# WPPConnect/WA-JS: Exporting WhatsApp Web Functions for Automation

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/wppconnect-team-wa-js
Generated for open source discovery and AI-assisted research.

WPPConnect/WA-JS is an open-source TypeScript project designed to export functions from WhatsApp Web. It enables developers to create custom interactions, automate tasks, and build powerful integrations for customer service, media sending, and more. With a comprehensive API, it simplifies the process of interacting with WhatsApp Web programmatically.

GitHub: https://github.com/wppconnect-team/wa-js
OSRepos URL: https://osrepos.com/repo/wppconnect-team-wa-js

## Summary

WPPConnect/WA-JS is an open-source TypeScript project designed to export functions from WhatsApp Web. It enables developers to create custom interactions, automate tasks, and build powerful integrations for customer service, media sending, and more. With a comprehensive API, it simplifies the process of interacting with WhatsApp Web programmatically.

## Topics

- whatsapp
- whatsapp-api
- whatsapp-automation
- typescript
- web-automation
- wppconnect
- bot-development
- integration

## Repository Information

Last analyzed by OSRepos: Sun Oct 12 2025 10:46:15 GMT+0100 (Western European Summer Time)
Detail views: 10
GitHub clicks: 3

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
WPPConnect/WA-JS is an open-source TypeScript project dedicated to exporting core functions from WhatsApp Web. This powerful tool empowers developers to build sophisticated automation solutions, custom interactions, and seamless integrations with WhatsApp. Whether you're looking to create customer service bots, automate media sending, or implement intelligent recognition systems, WA-JS provides the foundational capabilities. With a vibrant community, boasting over 580 stars and 170 forks on GitHub, it stands as a robust and actively maintained resource for WhatsApp Web automation.

## Installation
To get started with WPPConnect/WA-JS, you can follow these simple steps:

First, install the project dependencies:
bash
npm install


Next, build the JavaScript files. For production, use:
bash
npm run build:prd

For development, you can use `npm run build:dev`.

To launch a local browser with automatic injection for testing:
bash
npm run launch:local


## Examples
WPPConnect/WA-JS is designed to be injected into the browser where WhatsApp Web is running. Here are common ways to utilize it:

### Using TamperMonkey or GreaseMonkey:
For browser extensions, you can use a user script to inject `wppconnect-wa.js`:
javascript
// ==UserScript==
// @name         WA-JS Teste
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Simple example of WA-JS
// @author       You
// @match        https://web.whatsapp.com/*
// @icon         https://www.google.com/s2/favicons?domain=whatsapp.com
// @require      https://github.com/wppconnect-team/wa-js/releases/download/nightly/wppconnect-wa.js
// @grant        none
// ==/UserScript==

/* globals WPP */

(function () {
  'use strict';

  WPP.webpack.onReady(function () {
    alert('Ready to use WPPConnect WA-JS');
  });

  // Your code here...
})();


### Using Playwright for Headless Automation:
For programmatic control in Node.js environments, Playwright is an excellent choice:
typescript
import * as playwright from 'playwright-chromium';

async function start() {
  const browser = await playwright.chromium.launch();
  const page = await browser.newPage();

  await page.goto('https://web.whatsapp.com/');

  await page.addScriptTag({
    path: require.resolve('@wppconnect/wa-js'),
  });

  // Wait WA-JS load
  await page.waitForFunction(() => window.WPP?.isReady);

  // Evaluating code: See https://playwright.dev/docs/evaluating/
  const isAuthenticated: string = await page.evaluate(() =>
    WPP.conn.isAuthenticated()
  );

  // Sending message: See https://playwright.dev/docs/evaluating/
  const sendResult: string = await page.evaluate(
    (to, message) => WPP.chat.sendTextMessage(to, message),
    to,
    message
  );
}

start();


## Why Use WPPConnect/WA-JS?
WPPConnect/WA-JS offers a robust and flexible solution for anyone looking to interact with WhatsApp Web programmatically. Its key advantages include:

*   **Comprehensive API**: Access a wide range of WhatsApp functionalities, including connection status (`WPP.conn`), chat operations (`WPP.chat.sendTextMessage`, `WPP.chat.getChat`), contact management (`WPP.contact.getContact`, `WPP.contact.blockContact`), and group interactions (`WPP.group.createGroup`, `WPP.group.addParticipant`).
*   **Event-Driven Architecture**: Respond to real-time events, such as new messages, using `WPP.chat.on('chat.new_message')`, enabling dynamic and responsive applications.
*   **Flexible Integration**: Easily integrate with various environments, from browser user scripts (TamperMonkey, GreaseMonkey) to headless browser automation tools like Playwright.
*   **Open-Source and Community Support**: Benefit from an active open-source community, continuous development, and a wealth of shared knowledge and examples.
*   **Powerful Automation**: Build sophisticated bots and automation workflows for customer support, marketing, data extraction, and more, leveraging the full power of WhatsApp Web.

## Links
*   [GitHub Repository](https://github.com/wppconnect-team/wa-js)
*   [npm Package](https://www.npmjs.com/package/@wppconnect/wa-js)
*   [Discord Community](https://discord.gg/JU5JGGKGNG)
*   [YouTube Channel](https://www.youtube.com/c/wppconnect)
*   [WhatsApp Group](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
*   [Telegram Group](https://t.me/wppconnect)
*   [API Documentation](https://wppconnect.io/wa-js/types/ev.EventTypes.html)