npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anura-gate/watcher-whatsapp

v0.6.0

Published

GATE Watcher — Self-hosted daemon for WhatsApp Web integration. Credentials never leave your machine.

Readme

GATE Watcher — WhatsApp Web

Self-hosted daemon that connects to WhatsApp Web and pushes all message events to GATE cloud for security processing. Your WhatsApp session tokens never leave your machine.

How it works

Your Machine (Watcher)              GATE Cloud
┌─────────────────────┐        ┌──────────────────┐
│ WhatsApp Web session │───────>│ Security pipeline │
│ (tokens stay HERE)   │<───────│ (redact, policy,  │
│                      │ poll   │  audit, forward)  │
└─────────────────────┘        └──────────────────┘

Quick Start (CLI)

The fastest way — runs standalone with QR in your terminal.

cd watcher
npm install

# Create .env (or pass env vars directly)
cp .env.example .env
# Fill in GATE_URL, GATE_KEY, GATE_INTEGRATION_ID

npm start

Scan the QR code with your phone. Done.

Embed in Your App (SDK)

For production use — import the class, handle the QR however you want.

npm install @anura-gate/watcher-whatsapp
const { GateWatcher } = require("@anura-gate/watcher-whatsapp");

const watcher = new GateWatcher({
  gateUrl: "https://your-gate.vercel.app",
  gateKey: "gk-xxx",
  integrationId: "int_xxx",
});

// Render QR however you want — web page, API response, email, etc.
watcher.on("qr", (qr) => {
  // Example: send to frontend via WebSocket
  io.emit("whatsapp-qr", qr);
});

watcher.on("ready", () => {
  console.log("WhatsApp connected!");
});

// Every incoming message after GATE security processing
watcher.on("message", (msg, result) => {
  console.log(`From: ${msg.from}, Text: ${msg.body}`);
  console.log(`Security actions: ${result.securityActions}`);
  console.log(`Blocked: ${result.blocked}`);
});

// Outbound actions executed by the watcher
watcher.on("action_result", ({ action, success, error }) => {
  console.log(`${action}: ${success ? "done" : error}`);
});

await watcher.start();

// Later...
await watcher.stop();

SDK Events

| Event | Args | Description | |---|---|---| | qr | (qrString) | QR code string — render it however you want | | authenticated | — | WhatsApp session authenticated | | ready | — | Client ready, heartbeat + polling started | | message | (msg, result) | Incoming message processed by GATE | | message_sent | (msg, result) | Outgoing message processed by GATE | | action | (action) | Outbound action received from queue | | action_result | ({ actionId, action, success, result, error }) | Outbound action completed | | gate_error | ({ path, status, error }) | GATE API call failed | | limit_reached | (type) | Plan limit hit (e.g. "watcher_agents") | | disconnected | (reason) | WhatsApp disconnected | | stopped | — | Watcher fully shut down |

SDK Options

| Option | Required | Default | Description | |---|---|---|---| | gateUrl | Yes | — | GATE cloud URL | | gateKey | Yes | — | Virtual key (gk-xxx) | | integrationId | Yes | — | Integration ID (int_xxx) | | authDir | No | ./.wwebjs_auth | Path to store WhatsApp session | | heartbeatInterval | No | 30000 | ms between heartbeats | | pollInterval | No | 3000 | ms between outbound polls | | puppeteer | No | { headless: true } | Puppeteer launch options |

Advanced: Access whatsapp-web.js directly

const client = watcher.getWhatsAppClient();
const chats = await client.getChats();

Setup

  1. Go to GATE Dashboard → Integrations → Add Integration
  2. Select WhatsApp Web, copy the Integration ID
  3. Copy your Virtual Key from the Keys page
  4. Set the three env vars and run

Security model

  • WhatsApp session tokens stored in .wwebjs_auth/ on YOUR machine
  • GATE cloud never sees or stores your credentials
  • All message content passes through GATE's security pipeline
  • Billing, limits, and security enforced server-side