Skip to main content

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

The same resource route can optionally accept review submissions, but public writes need stronger validation and abuse protection than read-only requests.

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.
Add the values to local and deployed environment configuration:
JUDGEME_PRIVATE_API_TOKEN is a server credential. Never expose it through a PUBLIC_ variable, browser bundle, component setting, or client request.

Create a server-side Judge.me client

Judge.me recommends sending private API keys in the X-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.
Register it using your project’s routing convention. For a React Router configuration file, that can look like:
The route path and source filename are not part of the Judge.me contract. Choose names that fit your theme and keep localized route prefixes in mind.

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.
For localized storefronts, generate the resource-route URL with the same locale helper used elsewhere in the theme rather than hardcoding an unprefixed path.

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.
Register the section according to your theme’s component registry. The section can render Judge.me’s widget HTML directly or map structured review data into editable child components.

Add rating badges

Judge.me’s GET /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.
For rating badges visible above the fold, fetch them during the owning route or section loader so the initial HTML does not shift after hydration. Cache the result using the storefront’s normal caching strategy.

Optional: accept review submissions

Judge.me also supports creating reviews through its reviews API. If your storefront exposes a submission form:
  1. Submit to your Hydrogen resource route, never directly from the browser to Judge.me.
  2. Validate the product, reviewer name, email, rating, and body on the server.
  3. Add rate limiting and bot protection before forwarding the request.
  4. Return Judge.me errors as safe, user-facing messages without exposing credentials or raw upstream payloads.
  5. Revalidate or refresh the review list only after Judge.me accepts the submission.
Read-only display and public review submission are separate security boundaries. Launch display first unless storefront submissions are a confirmed requirement.

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.
Pilot is an implementation example, not a required dependency. Reuse the server-only authentication boundary and data flow while adapting components, routes, state management, and styling to your storefront.

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

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.