Product Reviews plugin for Medusa v2 — fork of @lambdacurry/medusa-product-reviews with Zod v4 / Medusa 2.14+ compatibility
Product review + moderation plugin for Medusa v2.
This package is a maintained fork of .
The upstream plugin crashes on Medusa 2.14+ because it pins while Medusa's own helpers (, , …) were upgraded to Zod v4 in 2.14. Mixing both versions breaks during middleware evaluation. This fork fixes that incompatibility and removes the dependency on the upstream-only .
Original code © Lambda Curry. See License / Attribution.
1pnpm add @jsm406/medusa-product-reviews2# or3yarn add @jsm406/medusa-product-reviews4# or5npm install @jsm406/medusa-product-reviews
Add it to your Medusa app's :
1import { defineConfig } from '@medusajs/medusa';23module.exports = defineConfig({4 // ...5 plugins: [6 {7 resolve: '@jsm406/medusa-product-reviews',8 options: {9 defaultReviewStatus: 'approved', // OPTIONAL. Default: 'approved'10 },11 },12 ],13});
pnpm medusa db:migrate
This plugin ships its own SDK () — a thin extension of that adds to both the admin and store namespaces. No external packages required.
1import { MedusaPluginsSDK } from '@jsm406/medusa-product-reviews/admin';23export const sdk = new MedusaPluginsSDK({4 baseUrl: process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL!,5 auth: { type: 'session' },6});
1// List reviews for a product2const { product_reviews, count } = await sdk.store.productReviews.list({3 product_id: 'prod_123',4 limit: 10,5 offset: 0,6});78// Create / update a review9await sdk.store.productReviews.upsert({10 reviews: [11 {12 order_id: 'order_123',13 order_line_item_id: 'item_abc',14 rating: 5,15 content: 'Excelente producto',16 images: [{ url: 'https://...' }],17 },18 ],19});2021// Stats22const { product_review_stats } = await sdk.store.productReviews.listStats({23 product_id: 'prod_123',24 limit: 1,25 offset: 0,26});
1// List all reviews (with filters)2const { product_reviews } = await sdk.admin.productReviews.list({3 status: 'pending',4 limit: 50,5 offset: 0,6});78// Approve / flag a review9await sdk.admin.productReviews.updateStatus('rev_123', 'approved');1011// Manage admin responses12await sdk.admin.productReviews.createResponse('rev_123', {13 content: 'Gracias por tu compra',14});1516await sdk.admin.productReviews.updateResponse('rev_123', {17 content: 'Gracias por tu compra, vuelve pronto!',18});1920await sdk.admin.productReviews.deleteResponse('rev_123');
| Method | Path | Description |
|---|---|---|
| GET | List all reviews | |
| PUT | Update review status | |
| POST | Add an admin response | |
| PUT | Update admin response | |
| DELETE | Delete admin response |
| Method | Path | Description |
|---|---|---|
| GET | List reviews | |
| POST | Create / update review | |
| GET | Review statistics |
| Option | Type | Default | Description |
|---|---|---|---|
| Status assigned to a new review when the customer submits it. |
A running PostgreSQL is required. The CLI defaults to , if env vars aren't set.
1# Build the plugin output2pnpm build34# Watch mode (rebuild + republish to yalc on every change)5pnpm dev67# Publish to local yalc registry for testing in your Medusa app8pnpm dev:publish910# Generate DB migrations11pnpm db:generate
Then in your Medusa app:
1pnpm medusa plugin:add @jsm406/medusa-product-reviews2pnpm install # if you use yarn/pnpm workspaces3pnpm dev
1# Bump version2npm version patch # or minor / major34# Build output to .medusa/server5pnpm medusa plugin:build67# Publish to npm (requires `npm login` first)8npm publish --access public
To be listed in the Medusa integrations page, the field already includes and .
This package is licensed under the MIT License.
The original source code is © Lambda Curry (https://github.com/lambda-curry/medusa-plugins), licensed under MIT. See the upstream repository for the canonical implementation and full history. This fork is an independent, drop-in replacement published under the same MIT terms.