[Bug] WhatsApp channel setup broken: openfang-whatsapp-gateway package not published to npm
Description
When attempting to add a WhatsApp channel via the OpenFang web portal (http://localhost:4200/#channels), the UI displays:
WhatsApp Web Gateway not running Run
npx openfang-whatsapp-gatewayor setWHATSAPP_WEB_GATEWAY_URL
However, running the suggested command fails because the package does not exist on npm:
$ npx openfang-whatsapp-gateway
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/openfang-whatsapp-gateway - Not found
npm error 404
npm error 404 'openfang-whatsapp-gateway@*' is not in this registry.
Root Cause
The gateway code exists in the repository at packages/whatsapp-gateway/, and the package.json defines the package as @openfang/whatsapp-gateway (scoped name), but:
- The package has never been published to npm — neither
openfang-whatsapp-gateway(unscoped) nor@openfang/whatsapp-gateway(scoped) exist on the registry - The UI references the wrong package name — the portal suggests
npx openfang-whatsapp-gateway(unscoped), butpackage.jsondefines it as@openfang/whatsapp-gateway(scoped with@openfang/prefix) - No documentation exists for the
WHATSAPP_WEB_GATEWAY_URLenvironment variable alternative
Steps to Reproduce
- Install OpenFang and run
openfang start - Open dashboard at
http://localhost:4200 - Navigate to Channels → Add WhatsApp
- Observe "WhatsApp Web Gateway not running" error
- Run the suggested
npx openfang-whatsapp-gatewaycommand - Get npm 404 error
Expected Behavior
One of the following:
- The
@openfang/whatsapp-gatewaypackage should be published to npm sonpxworks - The UI command should be corrected to match the actual package name
- Documentation should explain how to run the gateway manually from the repo source (
cd packages/whatsapp-gateway && npm install && node index.js) - Documentation should explain how to configure
WHATSAPP_WEB_GATEWAY_URLas an alternative
Environment
- OpenFang v0.1.0
- Node.js 18+
- npm 10.x
Workaround (untested)
Users may be able to run the gateway directly from a cloned repo:
git clone https://github.com/RightNow-AI/openfang.git
cd openfang/packages/whatsapp-gateway
npm install
node index.js
Related
- #111 — Same issue reported with less detail
Impact
This completely blocks WhatsApp channel integration, which is one of the core channel features advertised by OpenFang. New users following the setup flow hit a dead end with no documented workaround.
Fixed in v0.3.22. The help text was referencing an unpublished npm package (npx openfang-whatsapp-gateway). The WhatsApp Web gateway is actually auto-managed by the kernel. It embeds the gateway code at compile time, extracts it to ~/.openfang/whatsapp-gateway/, runs npm install, and spawns node automatically. The help text now explains this and tells users to ensure Node.js >= 18 is installed and WhatsApp is configured in config.toml. For external gateways, WHATSAPP_WEB_GATEWAY_URL can be set manually.
what are other gateways we can use?
For context on this and other community-reported issues, see #718 — requesting contributor recognition for the diagnostic and solution work behind these reports.