feat(4904): Add WhatsApp widget message prefill support#54
Merged
Conversation
anyelopetit
force-pushed
the
feat/4904-whatsapp-widget
branch
2 times, most recently
from
July 16, 2026 19:01
d7cf660 to
3395f69
Compare
anyelopetit
force-pushed
the
feat/4904-whatsapp-widget
branch
from
July 16, 2026 19:07
3395f69 to
f230307
Compare
anyelopetit
force-pushed
the
feat/4904-whatsapp-widget
branch
from
July 16, 2026 19:32
f230307 to
835310a
Compare
anyelopetit
marked this pull request as draft
July 20, 2026 17:19
anyelopetit
force-pushed
the
feat/4904-whatsapp-widget
branch
from
July 20, 2026 17:22
835310a to
3e469b1
Compare
anyelopetit
marked this pull request as ready for review
July 20, 2026 17:33
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eff37a8. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Related to hellotext/hellotext#4904. Adds WhatsApp Widget support to
hellotext.jsusing public config keywhatsappWidget.Issue
The Rails app can expose a configured WhatsApp Widget, but
hellotext.jsneeded to load it, pass install-level overrides, and coexist safely with Web Chat when both widgets are enabled.Root Cause
hellotext.jsonly loaded Web Chat from dashboard metadata.Solution
whatsappWidgetconfig support toHellotext.initialize.whatsappWidget; no publicwhatsappalias./v1/widgets/whatsapp/:id.number,body,placement, and launchericonUrlas request params.containermounting andwhatsappWidget: falseto disable automatic mounting.lib//dist/artifacts.Public API
Disable automatic mounting:
Decisions And Trade-Offs
whatsappWidgetas the only public config key becausewhatsappwas never shipped onmain.business.whatsappbecause it represents dashboard metadata, not public install config.Merge Recommendation
/v1/widgets/whatsapp/:id.Retro-Compatibility
webchat.business.whatsapp; public install config remainswhatsappWidget.whatsappalias or WhatsAppstrategyoption is exposed.whatsappWidget: falsedisables automatic WhatsApp Widget mounting without affecting Web Chat.Production Risks
dist/hellotext.jsartifact to be published./v1/widgets/whatsapp/:idbeing deployed with this SDK release.Pre-Deploy Checklist
/v1/widgets/whatsapp/:idis live.lib/anddist/artifacts are included.whatsappWidget: false,number/bodyoverrides, missing custom container, failed widget response, and Message?text=behavior.Post-Deploy Checklist
whatsappWidgetmounts the widget.webchatsnippets still mount Web Chat.Test Verification
npm run buildnpm test -- --runTestsByPath __tests__/api/whatsapp_widgets_test.js __tests__/core/whatsapp_configuration_test.js __tests__/models/whatsapp_widget_test.js __tests__/hellotext_test.js --runInBandnode --check src/hellotext.js && node --check src/core/configuration.js && node --check src/core/configuration/whatsapp.js && node --check src/api/whatsapp_widgets.jsgit diff --checkNote
Medium Risk
New runtime path depends on the Rails WhatsApp widget endpoint being deployed; failures are isolated but incorrect rollout could leave widgets missing on customer sites.
Overview
Adds dashboard-driven WhatsApp widget support to the browser SDK, mirroring the existing webchat flow.
Hellotext.initializeacceptswhatsappWidget(object overrides orfalseto skip auto-mount). Dashboard metadata frombusiness.whatsappis deep-merged with install options (number,bodyfor compose prefill, placement, launchericonUrl, container). A new API client fetches widget HTML from/v1/public/widgets/whatsapp/:idwith those overrides as query params; failed fetches, bad JSON, and missing/invalid containers no-op with warnings instead of breaking initialization.A
WhatsAppWidgetmodel waits for the Hellotext stylesheet, mounts into the configured container, and applies stacking classes when webchat is also present. README,docs/whatsapp.md, and TypeScript types document the public API.Reviewed by Cursor Bugbot for commit eff37a8. Bugbot is set up for automated code reviews on this repo. Configure here.