Skip to content

Add Trustpilot Review Collector widget for web - #2507

Merged
MusabShakeel576 merged 2 commits into
masterfrom
claude/trustpilot-wirex-reviews-ac711q
Sep 10, 2026
Merged

Add Trustpilot Review Collector widget for web#2507
MusabShakeel576 merged 2 commits into
masterfrom
claude/trustpilot-wirex-reviews-ac711q

Conversation

@MusabShakeel576

Copy link
Copy Markdown
Contributor

Summary

Adds Trustpilot's Review Collector widget to the web app, allowing users to leave reviews directly from the settings page. The widget is web-only and renders nothing on native platforms, which continue to use the OS review sheet instead.

Key Changes

  • New Trustpilot Widget Component (TrustpilotWidget.tsx):

    • Loads Trustpilot's bootstrap script once per page and mounts the Review Collector widget
    • Implements graceful fallback to a plain link when the script fails to load (ad blockers, proxies, offline)
    • Tracks widget visibility and user interactions via analytics
    • Configurable height and analytics context
  • Trustpilot Configuration (constants/trustpilot.ts):

    • Environment-based configuration with sensible defaults
    • Only requires EXPO_PUBLIC_TRUSTPILOT_BUSINESS_UNIT_ID to enable the widget
    • Provides fallback review URL when widget script is unavailable
    • Includes comprehensive documentation of each config value
  • Review Card Component (TrustpilotReviewCard.tsx):

    • Wraps the widget in a styled card ("Enjoying Solid?") for the settings page
    • Web-only, renders nothing on native platforms
    • Positioned in settings rather than as a prompt to avoid being intrusive
  • Store Review Hook Refactoring:

    • Renamed useCardDepositStoreReview to useAppOpenStoreReview for clarity
    • Updated to support both Rain (deposit-based) and Wirex (balance-based) eligibility signals
    • Added StoreReviewSignal enum to track which population triggered the prompt
    • Enhanced AppOpenResponse with spendableUsd and signal fields
  • Component Renaming:

    • CardDepositStoreReviewTriggerAppOpenStoreReviewTrigger to reflect broader eligibility logic
  • Analytics & Configuration:

    • Added Trustpilot-specific tracking events
    • Updated .env.example with Trustpilot configuration variables
    • Added comprehensive test coverage for configuration logic

Implementation Details

  • The widget uses Trustpilot's standard embed markup with data-* attributes, allowing the script to configure itself
  • Bootstrap script is loaded once globally and shared across all widget instances on the page
  • 8-second timeout on script load prevents indefinite hangs; falls back to plain link on failure
  • Web platform detection ensures native apps never attempt to render the widget
  • Configuration is validated at import time; empty business unit ID is treated as unconfigured

https://claude.ai/code/session_01SeWJWhmRXHqL4VNB8ktvia

Two halves of the same goal — ask more of the people who are actually
getting value out of Solid, without asking any of them often.

**Web/desktop gets a Trustpilot Review Collector.** There is no native
review sheet on web, so the web app had no way to ask at all. Trustpilot's
*in-app* review collector — the one that takes the rating inside our own
UI and posts it through their API — is a paid plan, so this is the free
embeddable widget: their stars, their form, one script. Every value is
environment-configured (`EXPO_PUBLIC_TRUSTPILOT_*`) and the widget hides
itself until the business unit id is set, so a build without the values
renders nothing rather than an empty Trustpilot frame. When the script is
blocked — an ad blocker, a corporate proxy — a plain link takes its place,
because a blocked script should cost us the branding, not the review.

It lives in settings. The widget is standing UI rather than a prompt: it
cannot be timed to a happy moment the way the native sheet is, so putting
it on a screen users pass through would be noise on every visit. In
settings it is found by someone already looking for account actions.

**The native prompt now covers Wirex cardholders.** It only ever fired on
Rain card deposits, and a Wirex card is never funded — it spends the
user's own wallet and savings — so its holders could never qualify. The
backend now reads the signal that matches the issuer; this side just
carries the new decision reasons through and reports which population a
prompt came from, so the funnel can be read per issuer rather than as one
average over two quite different triggers.

`useCardDepositStoreReview` is renamed to `useAppOpenStoreReview` (and its
trigger with it): the hook fires on an app open and deposits are now only
one of the things that can qualify one, so the old name described a case
rather than the rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeWJWhmRXHqL4VNB8ktvia
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
solid-app Ignored Ignored Preview Sep 10, 2026 1:47pm UTC
solid-app-staging Ignored Ignored Preview Sep 10, 2026 1:47pm UTC

Request Review

@claude

claude Bot commented Sep 10, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

The Trustpilot components are plain `.tsx` rather than `.web.tsx`, so Metro
ships them in the native bundle. That is only safe because every web-only
construct sits behind a `Platform.OS === 'web'` guard — including raw
`<div>`/`<a>` elements, which React Native has no renderer for and which
would throw if they ever reached it.

A guard like that is one careless edit away from sitting below the code it
protects, and the failure would surface only on a device: a red screen on
the settings screen, invisible to `tsc` and to any web build. Render both
components under the native preset, with Trustpilot reported as fully
configured so the platform guard is the branch actually under test rather
than the unconfigured early return.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeWJWhmRXHqL4VNB8ktvia
@MusabShakeel576
MusabShakeel576 merged commit 4de8546 into master Sep 10, 2026
5 checks passed
@MusabShakeel576
MusabShakeel576 deleted the claude/trustpilot-wirex-reviews-ac711q branch September 10, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants