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

node-red-contrib-whatsapp-bridge

v1.4.1

Published

Node-RED nodes for WhatsApp via whatsapp-web.js or @whiskeysockets/baileys. Drop-in replacement for node-red-contrib-whatsapp-link with bug fixes and modernization.

Downloads

131

Readme

node-red-contrib-whatsapp-bridge

Node-RED nodes for WhatsApp via whatsapp-web.js or @whiskeysockets/baileys.

This is a fork of [email protected] by Ravi Mishra, with bug fixes and modernization. It is a drop-in replacement — the same six Node-RED node types (whatsappLink, chats-in, chats-out, group-out, admin, reply) are registered, the same session-storage paths are used, and existing flow JSON loads without edits.

Why

The upstream package works for happy-path phone-number recipients but fails or behaves badly in several real scenarios — silent send failures for @lid recipients, double-sending of button payloads, crashes on message.key.remoteJid, swallowed status timers, a typo that broke the destroy admin command, and more. This fork fixes them while staying compatible with existing flows. See CHANGES.md for the full list (16 documented bugs, all fixed).

Install

For an existing Node-RED whatsapp-link user, see MIGRATION.md.

For a fresh install:

cd ~/.node-red
npm install node-red-contrib-whatsapp-bridge

Nodes

| Node | Purpose | | -------------- | ----------------------------------------------------------------- | | whatsappLink | Config node holding the underlying WhatsApp client | | chats-in | Inbound message events | | chats-out | Outbound message sender (text, image, buttons) | | group-out | Outbound to a configured group JID | | admin | destroy / logout / restart / test admin commands | | reply | Auto-reply or react when an incoming message starts with a prefix |

The Baileys backend (waSocketClient) supports buttons, lists, and template messages. The whatsapp-web.js backend (waWebClient) supports text and images and renders the QR code in the Node-RED admin node.

Inputs of interest

chats-out / group-out:

| Field | Description | | -------------- | ---------------------------------------------------------------- | | msg.payload | Text body, or a buttons/list/template object (Baileys) | | msg.image | Base64 image; msg.payload becomes the caption | | msg.toNumber | Recipient — phone number, full JID, or array of either | | msg.key | Pass message.key from a chats-in event to reply to that chat |

Recipient strings containing @ are passed through unchanged. Both backends accept @lid, @c.us, @g.us, @s.whatsapp.net, and @newsletter.

chats-in emits:

| Field | Description | | ------------------- | ------------------------------------------------------------------- | | msg.payload | Message body | | msg.from | Sender, digit-stripped (legacy — still emitted) | | msg.chatID | Chat, digit-stripped (legacy — still emitted) | | msg.sourceJid | Sender, full JID including suffix — persist this to reply later | | msg.sourceChatJid | Chat, full JID | | msg.message | The original whatsapp-web.js Message or Baileys envelope | | msg.reaction | {emoji, targetKey} for reaction messages (v1.4) | | msg.mediaInfo | {kind, mimetype, filename, fileLength} for media messages (v1.4) |

Actions (v1.4)

Beyond text/image sends, chats-out / group-out recognise these msg shapes and dispatch the corresponding backend call:

| Field | Effect | | -------------------- | ----------------------------------------------------------------------------------------------- | | msg.markRead | Send read receipts. Pass a message.key (from chats-in) or array of keys. | | msg.presence | 'composing' / 'recording' / 'paused' / 'available' / 'unavailable'. Recipient resolved from msg.toNumber / msg.key / the node default. Baileys 'available'/'unavailable' are global. | | msg.react | {emoji, key} — react to a message. emoji: '' clears. Web backend additionally needs msg.message. | | msg.poll | {name, values, selectableCount?}. Baileys only. | | msg.downloadMedia | true (uses the carried envelope) or an explicit envelope. Result is attached as msg.media = {mimetype, data:Buffer, filename?}. |

Action messages flow through the same retry + sequential queue as regular sends. They can be combined: a single msg with both markRead and react runs them in order.

Tuning

The send queue and retry behaviour read from environment variables at load time. Set them where Node-RED is launched (e.g. environment: in docker-compose.yml). Defaults match the v1.0 behaviour with the addition of per-recipient pacing.

| Variable | Default | What it controls | |-----------------------------------|---------|-----------------------------------------------------------------------------------------------| | WA_BRIDGE_PER_RECIPIENT_GAP_MS | 1500 | Minimum gap between consecutive sends to the same JID. Different recipients run back-to-back. | | WA_BRIDGE_MAX_QUEUE_DEPTH | 1000 | Max pending sends per outbound node before further inputs are dropped with node.error. | | WA_BRIDGE_RETRY_ATTEMPTS | 3 | Total attempts for transient send errors (connection-closed, 408, 503, 410/428/515). | | WA_BRIDGE_RETRY_BACKOFF_MS | 500 | Initial backoff; doubles per attempt (500 → 1000 → 2000). |

Development

npm install
npm test            # 86 tests (78 unit + 5 smoke + 3 isRetryable)

Smoke tests use node-red-node-test-helper and require Node-RED itself; both are devDependencies. Unit tests use only node:test and run without any install.

License

ISC. See LICENSE. Original work © Ravi Mishra; fork modifications © M.Alsouki