Repository navigation
Lead WhatsApp widget links through Hellotext's click endpoint - #102
Merged
Merged
Conversation
The widget's links now go to Hellotext's click endpoint, which records the click, adds the session's reference to the prefilled message and redirects to wa.me. The server caches one widget for every visitor, so the links it renders can't carry the session. hellotext.js rebuilds each of them from the endpoint URL the widget carries in data-hellotext--whatsapp-widget-click-url-value, keeping the number and message the widget rendered (overrides included) and adding the session. Without a session the links stay as rendered and still reach WhatsApp. The widget fetch also sends the session, so the visitor's view is counted. The server leaves it out of its cache key. Rebuilt lib and dist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
What it does
/v1/public/widgets/whatsapp/:id/click?number=…&text=…. That endpoint records the click, adds the session's reference to the message and redirects towa.me. The widget is cached once for every visitor, so its links can't carry the session.WhatsAppWidgetrebuilds each link from the endpoint URL indata-hellotext--whatsapp-widget-click-url-value, keeping the renderednumberandtext(overrides included) and addingsession. Links that don't lead to the endpoint are left alone. Without a session the links stay as rendered and still reach WhatsApp, with nothing recorded.session, so the server can count the visitor's view. The server leaves it out of its cache key, so visitors still share the cached widget.Every click goes through the server; there's no browser-side dedupe. The server counts a session once a day in its unique clicks, and every click needs the server to add the reference.
Rebuilt
libanddist.docs/whatsapp.mdnow says the links go through Hellotext.Tests
yarn test: 46 suites, 1142 tests pass. New tests cover the session on the widget fetch (and its absence) and the rebuilt links (session added, other links untouched, links kept without a session).🤖 Generated with Claude Code