@amboras-dev/trustpilot
v2.0.0
Published
Trustpilot TrustBox widget + invitation hooks for Amboras storefronts
Keywords
Readme
@amboras-dev/trustpilot
Trustpilot integration for Amboras storefronts. Ships the TrustBox widget
bootloader, the TrustBox slot component, domain-verification <meta> tag
injection, and a typed getTrustpilotConfig helper for reading non-secret
plugin config from Medusa.
Exports
.- server-safe entry: types + config helpers../get-config-getTrustpilotConfig({ baseUrl?, publishableApiKey?, storeId? })../slot-components- client-only React components:TrustpilotBootstrap-rootProvidersslot component. Idempotently injects the TrustBox bootloader script and renders thetrustpilot-one-time-domain-verification-idmeta tag.TrustBox- the widget renderer. Renders<div class="trustpilot-widget">and callswindow.Trustpilot.loadFromElement(el, true)once the bootloader resolves.
Notes
- Storefronts are Next.js 15+/React 19 only. React 19's built-in
<meta>hoisting is required for the domain-verification tag to reach<head>. - Trustpilot has NO test mode. Any
sendInvitationcall triggers a real customer email. The invitation dispatch itself lives in the Medusa module (medusa-backend-orchestrator), not this package. - The invitations API has no server-side dedup on
referenceNumber. Dedup is enforced by thetrustpilot_invitations (store_id, order_id) UNIQUEoutbox in the Medusa module.
Config shape
getTrustpilotConfig returns the non-secret subset. Secrets (api_key,
api_secret, business_user_id, sender_email) never cross the
storefront boundary.
