Integrate Judge.me Reviews with Shopify Hydrogen
Judge.me provides product ratings, review widgets, and review-management APIs for Shopify stores. In a Hydrogen storefront, the safest integration keeps the Judge.me credential on the server and exposes only the review data or widget HTML that the storefront needs. This guide describes a theme-independent architecture. File names and route conventions are examples; adapt them to your Hydrogen project. The Weaverse Pilot theme is included as a working reference, not as a required project structure.What you will build
Choose the response shape
Judge.me supports two useful approaches:
For most storefronts, start with the widget endpoints. Judge.me documents their HTML responses as sanitized and safe to embed. Move to structured data only when your design requires full control.
Prerequisites
- Judge.me installed and configured for the Shopify store.
- A Judge.me private API key.
- The Shopify store domain, such as
example.myshopify.com. - A Hydrogen project with a server runtime such as Shopify Oxygen.
Create a server-side Judge.me client
Judge.me recommends sending private API keys in theX-Api-Token header. Keep authentication in one helper so UI components never handle the credential.
Add a Hydrogen resource route
The route below proxies Judge.me’s product-review widget. It accepts the product handle and pagination values but reads authentication only from the server environment.Render the reviews in Hydrogen
Load the full review widget when the section is needed instead of blocking every product-page request. A compact rating badge can still be fetched with the product loader when it is important for the initial render.Only inject the widget HTML returned directly by Judge.me. Do not pass visitor input or arbitrary CMS content through
dangerouslySetInnerHTML.Make the reviews editable in Weaverse
Wrap the review UI in a Weaverse section when merchants should control its heading, description, spacing, colors, or page placement from Studio. Keep API credentials in the server environment; expose only presentation settings in the schema.Add rating badges
Judge.me’sGET /widgets/preview_badge endpoint returns a compact rating badge for product pages, cards, and quick views. Use the same server helper with a product handle or external Shopify product ID.
Optional: accept review submissions
Judge.me also supports creating reviews through its reviews API. If your storefront exposes a submission form:- Submit to your Hydrogen resource route, never directly from the browser to Judge.me.
- Validate the product, reviewer name, email, rating, and body on the server.
- Add rate limiting and bot protection before forwarding the request.
- Return Judge.me errors as safe, user-facing messages without exposing credentials or raw upstream payloads.
- Revalidate or refresh the review list only after Judge.me accepts the submission.
Pilot reference implementation
The Pilot theme demonstrates this architecture with its own project conventions:Review resource route
Server-side Judge.me requests for badges, review widgets, pagination, and submissions.
Reviews section
A Weaverse product-page section with summary, list, pagination, and form components.
Rating badge
Compact Judge.me ratings reused across product surfaces.
Route registration
React Router registration for the localized reviews resource route.
Production checklist
- Private API token is available only on the server.
- Store domain matches the shop connected to Judge.me.
- Product handles or external IDs resolve to the expected Judge.me products.
- Pagination inputs are bounded before calling Judge.me.
- Empty, loading, error, and no-review states render without layout jumps.
- Resource-route URLs preserve the active locale when required.
- Review responses are cached appropriately; write requests are not cached.
- Public submission routes have validation, rate limiting, and bot protection.
Troubleshooting
Related
Third-party Integration
General patterns for external services in Weaverse Hydrogen themes.
Data Connectors
Make route and API data available to editable components.
Custom Routing
Define resource routes in a React Router-based Hydrogen storefront.
Judge.me API documentation
Authentication, widgets, reviews, and endpoint parameters.