• Сообщество
  • Блог
Документация
Плагины и интеграцииВсе расширения для Medusa от сообществаЭкспертыПодберите специалиста для разработки и развития вашего проекта на Medusa
КейсыПосмотрите примеры Medusa в продакшене и успешные внедрения
Меч Moscow
Комплексная e-commerce платформа на Medusa для московского fashion-бренда

Меч Moscow · Fashion

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы Medusa
  • Плагины и интеграции
  • Эксперты
  • Кейсы
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация Gorgo
  • Связаться с нами
  • TelegramGitHub
Плагины
P

Product reviews

Product Reviews plugin for Medusa v2 — fork of @lambdacurry/medusa-product-reviews with Zod v4 / Medusa 2.14+ compatibility

npm install @jsm406/medusa-product-reviews
Категория
Другое
Создано
Jsm406
Версия
1.0.3
Последнее обновление
3 дня назад
Ежемесячные загрузки
Загрузка данных
Звезды на Github
0
npmNPMGitHubGithub

@jsm406/medusa-product-reviews

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.

Why this fork?

  • Compatible with Medusa 2.14, 2.15 and 2.16+ (Zod v4 under the hood).
  • Backend schemas so they share the same Zod instance Medusa uses — no more crash.
  • Admin types are vendored locally; no more dependency.
  • Same feature set: product reviews, ratings, stats, admin responses, moderation workflow, store + admin SDK.

Features

  • Product reviews with 1–5 star ratings
  • Review statistics and analytics (per-product aggregate + rating distribution)
  • Moderation workflow ( / / )
  • Admin response management (create / update / delete)
  • Store + Admin SDK for both Next.js / storefront clients and the Medusa Admin UI customisations

Prerequisites

  • Medusa >= 2.14.0 backend (works down to 2.13.x; 2.14+ recommended)
  • PostgreSQL with a Medusa-compatible schema

Installation

1pnpm add @jsm406/medusa-product-reviews
2# or
3yarn add @jsm406/medusa-product-reviews
4# or
5npm install @jsm406/medusa-product-reviews

Register the plugin

Add it to your Medusa app's :

1import { defineConfig } from '@medusajs/medusa';
2
3module.exports = defineConfig({
4 // ...
5 plugins: [
6 {
7 resolve: '@jsm406/medusa-product-reviews',
8 options: {
9 defaultReviewStatus: 'approved', // OPTIONAL. Default: 'approved'
10 },
11 },
12 ],
13});

Run migrations

pnpm medusa db:migrate

SDK Usage

This plugin ships its own SDK () — a thin extension of that adds to both the admin and store namespaces. No external packages required.

Setup (e.g. in a Next.js storefront)

1import { MedusaPluginsSDK } from '@jsm406/medusa-product-reviews/admin';
2
3export const sdk = new MedusaPluginsSDK({
4 baseUrl: process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL!,
5 auth: { type: 'session' },
6});

Storefront operations

1// List reviews for a product
2const { product_reviews, count } = await sdk.store.productReviews.list({
3 product_id: 'prod_123',
4 limit: 10,
5 offset: 0,
6});
7
8// Create / update a review
9await 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});
20
21// Stats
22const { product_review_stats } = await sdk.store.productReviews.listStats({
23 product_id: 'prod_123',
24 limit: 1,
25 offset: 0,
26});

Admin operations

1// List all reviews (with filters)
2const { product_reviews } = await sdk.admin.productReviews.list({
3 status: 'pending',
4 limit: 50,
5 offset: 0,
6});
7
8// Approve / flag a review
9await sdk.admin.productReviews.updateStatus('rev_123', 'approved');
10
11// Manage admin responses
12await sdk.admin.productReviews.createResponse('rev_123', {
13 content: 'Gracias por tu compra',
14});
15
16await sdk.admin.productReviews.updateResponse('rev_123', {
17 content: 'Gracias por tu compra, vuelve pronto!',
18});
19
20await sdk.admin.productReviews.deleteResponse('rev_123');

Endpoints

Admin

MethodPathDescription
GETList all reviews
PUTUpdate review status
POSTAdd an admin response
PUTUpdate admin response
DELETEDelete admin response

Store

MethodPathDescription
GETList reviews
POSTCreate / update review
GETReview statistics

Module Options

OptionTypeDefaultDescription
Status assigned to a new review when the customer submits it.

Local Development

A running PostgreSQL is required. The CLI defaults to , if env vars aren't set.

1# Build the plugin output
2pnpm build
3
4# Watch mode (rebuild + republish to yalc on every change)
5pnpm dev
6
7# Publish to local yalc registry for testing in your Medusa app
8pnpm dev:publish
9
10# Generate DB migrations
11pnpm db:generate

Then in your Medusa app:

1pnpm medusa plugin:add @jsm406/medusa-product-reviews
2pnpm install # if you use yarn/pnpm workspaces
3pnpm dev

Publishing this fork

1# Bump version
2npm version patch # or minor / major
3
4# Build output to .medusa/server
5pnpm medusa plugin:build
6
7# Publish to npm (requires `npm login` first)
8npm publish --access public

To be listed in the Medusa integrations page, the field already includes and .

License / Attribution

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.

Changes from upstream

  1. Zod v4 compatibility (Medusa 2.14+):
    • All backend Zod schemas now to share the same Zod instance as Medusa's helpers. This is the upstream codemod approach: https://docs.medusajs.com/learn/codemods/replace-zod-imports.
    • dependency bumped from → so the admin bundle can keep using its own Zod for browser-side form validation without colliding with Medusa's Zod v4 in the backend runtime.
  2. Removed dependency on . The SDK and admin types are vendored under and .
  3. Package renamed from to . No code-level migration is needed beyond updating the string in .

Еще в этой категории

Посмотреть все
Другое
Gati logo

Gati

От Devx Commerce

Синхронизируйте Medusa с Gati ERP

Загрузка данных
npm
Другое
Product Reviews logo

Product Reviews

От Lambda Curry

Добавляйте рейтинги, отзывы и модерацию товаров

Загрузка данных
GitHubnpm
Другое
Variant Images logo

Variant Images

От Betanoir

Организуйте и загружайте варианты изображений в Medusa

Загрузка данных
GitHubnpm

Еще от этого автора

Посмотреть все
Платежи
R

Redsys

От Jsm406

Redsys / Sermepa TPV Virtual payment provider plugin for MedusaJS v2

Загрузка данных
GitHubnpm