Skip to main content

CamouChat WhatsApp 🟢

[!IMPORTANT] 🦊 This is the CamouChat WhatsApp Plugin Repository. If you are looking for the main CamouChat project or full ecosystem documentation, please visit our Central Repository.

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

[!WARNING] This package requires a one-time binary fetch for the underlying Camoufox browser engine after installation. See Setup below.

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

Using uv (Recommended)

uv add camouchat-whatsapp "camoufox[geoip]"

Using pip

pip install camouchat-whatsapp "camoufox[geoip]"

Setup

[!WARNING] uv sync / pip install alone are not enough. You must fetch the Camoufox browser binary separately.

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

[!WARNING] This package is currently in BETA Version. Errors and inconsistencies are expected.

  • It is highly recommended to use test accounts.
  • Start with one browser in headed mode.
  • Avoid using multi-account automation until the full 1.0.0 release.

[!CAUTION] Rate Limiting Patterns

Rate limiting is currently a manual concern. An inbuilt limiter will be added in a future version with Monitor&Metrics insertion.

Until then, ensure you manually rate limit inside your @on_newMsg handler to avoid account bans.

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
camouchat_whatsapp-0.7.3.tar.gz 180.5 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

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