Skip to main content

CamouChat WhatsApp 🟢

High-stealth WhatsApp automation plugin for the CamouChat ecosystem. Built on top of camouchat-browser and WA-JS, providing a structured, API-driven pipeline for multi-account automation with end-to-end encrypted message storage.

PyPI PyPI Downloads GitHub Release

Key Features

  • WA-JS Integration: Uses the internal WhatsApp Web API via wa-js — not fragile DOM selectors.
  • Multi-Account Isolation: Each account runs in a sandboxed profile with isolated cookies, storage, and fingerprints.
  • E2E Encryption: All stored messages are encrypted at rest using AES-256-GCM.
  • Async-First: Fully asyncio-native for high-throughput multi-session workloads.
  • Humanized Behavior: Mouse movements, typing cadence, and delays mimic organic user behavior.

Installation

uv add camouchat-whatsapp "camoufox[geoip]"

Using pip

pip install camouchat-whatsapp "camoufox[geoip]"

Setup

With uv

uv run python -m camoufox fetch

With pip

python -m camoufox fetch

This downloads the latest hardened Firefox binary used internally by Camoufox.

Quick Start

import asyncio
import base64
import os

from camouchat_browser import BrowserConfig, CamoufoxBrowser, ProfileManager
from camouchat_core import Platform, KeyManager, MessageDecryptor, MediaType
from camouchat_whatsapp import (
    Login,
    WapiSession,
    InteractionController,
    MediaController,
    MessageModelAPI,
    FileTyped,
    RegistryConfig,
    on_newMsg,
)

async def main():
    # 1. Profile
    pm = ProfileManager()
    profile = pm.create_profile(platform=Platform.WHATSAPP, profile_id="work")

    # 2. Browser
    config = BrowserConfig.from_dict({"platform": Platform.WHATSAPP, "headless": False})
    browser = CamoufoxBrowser(config=config, profile=profile)
    page = await browser.get_page()

    # 3. Login (reuses saved session automatically)
    login = Login(page=page, profile=profile)
    await login.login(method=0)

    # 4. API Controllers
    wapi = WapiSession(page=page)
    interaction = InteractionController(page=page, wapi=wapi)
    media = MediaController(page=page, wapi=wapi, profile=profile)

    # 5. Message Hook (Auto-Storage + E2E Encryption)
    registry = RegistryConfig(profile=profile, store=True, encrypt=True)

    @on_newMsg(wapi_session=wapi, config=registry)
    async def handle_message(msg: MessageModelAPI):
        # --- Decrypt message on-the-fly for command processing ---
        plain_body = msg.body
        if msg.encryption_nonce and msg.body:
            key_path = profile.encryption.get("key_file")
            if key_path:
                with open(key_path, "rb") as f:
                    raw_key = KeyManager.decode_key_from_storage(f.read().decode())
                try:
                    nonce_b = base64.b64decode(msg.encryption_nonce)
                    cipher_b = base64.b64decode(msg.body)
                    plain_body = MessageDecryptor(raw_key).decrypt_message(
                        nonce_b, cipher_b, msg.id_serialized or None
                    )
                except Exception as e:
                    print(f"Decryption failed: {e}")

        print(f"\n[+] New Msg from {msg.jid_From}: {plain_body}")

        # --- Command Handling ---
        if plain_body == "!ping":
            # API send (Zero DOM interaction - stealthy)
            await interaction.send_api_text(
                chat_id=msg.jid_From,
                text="🏓 Pong!",
                quoted_msg_id=msg.id_serialized,
            )

        elif plain_body and plain_body.startswith("!echo "):
            # Humanized DOM send (Simulates keyboard typing)
            echo_text = plain_body.replace("!echo ", "")
            await interaction.send_text(
                message=msg,
                text=f"Echo: {echo_text}",
                quote=True,
                send=True,
            )

        elif msg.msgtype in ("image", "video", "document"):
            # Media handling (Save & Re-upload)
            saved_path = await media.save_media(message=msg)
            if saved_path:
                print(f"[✔] Media saved to {saved_path}")

                # Re-upload the same media back
                mtype = MediaType.IMAGE if msg.msgtype == "image" else MediaType.DOCUMENT
                file_obj = FileTyped(uri=saved_path, name=os.path.basename(saved_path), mime_type=msg.mimetype)

                await media.add_media(mtype=mtype, file=file_obj, force=True)

    # 6. Activate listener and wait
    await handle_message()
    print("[\u2714] Hook active. Try sending !ping, !echo <text>, or an image in WhatsApp.")
    await asyncio.Event().wait()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass

Anti-Ban Best Practices

  • Use residential proxies and enable GeoIP matching.
  • Run only one visible browser (others auto-switch to headless).
  • Respect rate limits — avoid burst-sending messages.
  • Use test accounts before deploying on real numbers.

⚠️ Important Beta Information

Documentation

Guide Description
WA-JS Integration Bridge architecture, stealth engine, ChatStore sync caveats
Core — Login & UI Config Login (QR + phone code), WebSelectorConfig
Chat API Manager get_chat_list, open_chat, all RAM/DOM methods
Message API Manager get_messages, extract_media, push listener
Controllers InteractionController, MediaController, send_api_text
Event Architecture @on_newMsg, @on_storage, @on_encrypt decorator pipeline
Storage SQLAlchemyStorage, dialect config, Query retrieval layer
API Models ChatModelAPI, MessageModelAPI field reference
Agent Reference 🤖 Full API surface + rules for AI agents / LLM tooling
Core SDK camouchat-core protocol definitions
Browser Plugin ProfileManager, BrowserConfig, CamoufoxBrowser

Real-World Test Scripts

For complete, runnable integration examples see the test directories:

  • E2E Scripts — full end-to-end integration tests covering message events, media, group operations, and command handling.
  • Smoke Tests — lightweight bridge validation script that checks every API surface (messages, chats, groups, media, privacy, labels, newsletters) against a live session.

⚖️ Security & Ethics

CamouChat's strict policy regarding acceptable automation, anti-spam, and stealth disclaimers can be found in our central ecosystem hub:

👉 SECURITY.md


Acknowledgements & Third-Party Code

CamouChat WhatsApp uses portions of the wa-js library developed by the WPPConnect Team.

wa-js provides the internal WhatsApp Web JavaScript bridge that powers reliable, selector-free automation. It is distributed under the Apache License 2.0.

See the NOTICE file for full compliance details.

License

MIT License. See LICENSE for details.

Metadata

Release files for camouchat-whatsapp 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for camouchat-whatsapp 0.7.3
File Size Uploaded Provenance Actions
camouchat_whatsapp-0.7.3.tar.gz 180.5 kB With provenance Details for camouchat_whatsapp-0.7.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for camouchat-whatsapp 0.7.3
File Interpreter ABI Platform Actions
camouchat_whatsapp-0.7.3-py3-none-any.whl Python 3 none any Details for camouchat_whatsapp-0.7.3-py3-none-any.whl

Total release size: 373.8 kB

Release files / camouchat_whatsapp-0.7.3.tar.gz

Download URL camouchat_whatsapp-0.7.3.tar.gz
Size 180.5 kB
Tags Source
SHA-256 checksum
How to use checksums
70533eb8e2911e3a7d273b1a0bf23c718b5495f270cd4cf2af8f575abc329c2f
BLAKE2b-256 checksum
How to use checksums
7d00ca2cf1a2c0e1d0053d3aeeac058b5496ab4f6ee901c09c9bc394ca5803f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 3, 2026.

Transparency log

Release files / camouchat_whatsapp-0.7.3-py3-none-any.whl

Download URL camouchat_whatsapp-0.7.3-py3-none-any.whl
Size 193.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d3cb078417108c508e98a8c102d0ea5d84264394f3d12d2cb71c3f90fbadd66
BLAKE2b-256 checksum
How to use checksums
b6c929edc50f2061b892f9302dbf77d1219923d6648a999c6ce9da6a615adb7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 3, 2026.

Transparency log

Security for camouchat-whatsapp 0.7.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for camouchat_whatsapp-0.7.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page