openfang icon indicating copy to clipboard operation
openfang copied to clipboard

[Bug] WhatsApp channel setup broken: openfang-whatsapp-gateway package not published to npm

Open f-liva opened this issue 8 months ago • 3 comments

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-gateway or set WHATSAPP_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:

  1. The package has never been published to npm — neither openfang-whatsapp-gateway (unscoped) nor @openfang/whatsapp-gateway (scoped) exist on the registry
  2. The UI references the wrong package name — the portal suggests npx openfang-whatsapp-gateway (unscoped), but package.json defines it as @openfang/whatsapp-gateway (scoped with @openfang/ prefix)
  3. No documentation exists for the WHATSAPP_WEB_GATEWAY_URL environment variable alternative

Steps to Reproduce

  1. Install OpenFang and run openfang start
  2. Open dashboard at http://localhost:4200
  3. Navigate to Channels → Add WhatsApp
  4. Observe "WhatsApp Web Gateway not running" error
  5. Run the suggested npx openfang-whatsapp-gateway command
  6. Get npm 404 error

Expected Behavior

One of the following:

  • The @openfang/whatsapp-gateway package should be published to npm so npx works
  • 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_URL as 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.

f-liva avatar Mar 05 '26 16:03 f-liva

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.

jaberjaber23 avatar Mar 05 '26 17:03 jaberjaber23

what are other gateways we can use?

kaan-escober avatar Mar 07 '26 11:03 kaan-escober

For context on this and other community-reported issues, see #718 — requesting contributor recognition for the diagnostic and solution work behind these reports.

f-liva avatar Mar 18 '26 08:03 f-liva