Enhance product reviews with advanced features
An enhanced plugin that adds comprehensive product review and moderation capabilities to your Medusa application, with advanced filtering, pagination, and admin UI integration.
Enhanced version with improved admin UI, filtering capabilities, and better integration with Medusa v2.
See a demo in our Medusa Starter
1yarn add @lambdacurry/medusa-product-reviews23# or, if you're using yarn workspaces4yarn workspace my-app add @lambdacurry/medusa-product-reviews
1module.exports = defineConfig({2 plugins: [3 {4 resolve: '@lambdacurry/medusa-product-reviews',5 options: {6 defaultReviewStatus: 'pending', // OPTIONAL, default is 'approved'7 },8 },9 ],10});
yarn medusa db:migrate
The plugin provides a built-in SDK for both store and admin operations using Medusa's native HTTP client.
1// List product reviews2const { reviews, count } = await sdk.store.productReviews.list(3 query: StoreListProductReviewsQuery,4 headers?: ClientHeaders5);67// Create/Update a review8const review = await sdk.store.productReviews.upsert(9 data: StoreUpsertProductReviewsDTO,10 headers?: ClientHeaders11);1213// Get review statistics14const stats = await sdk.store.productReviews.listStats(15 query: StoreListProductReviewStatsQuery,16 headers?: ClientHeaders17);
1// List reviews2const { reviews, count } = await sdk.admin.productReviews.list(3 query: AdminListProductReviewsQuery4);56// Update review status7const review = await sdk.admin.productReviews.updateStatus(8 productReviewId: string,9 status: 'pending' | 'approved' | 'flagged'10);1112// Manage review responses13const review = await sdk.admin.productReviews.createResponse(14 productReviewId: string,15 data: AdminCreateProductReviewResponseDTO16);1718await sdk.admin.productReviews.updateResponse(19 productReviewId: string,20 data: AdminUpdateProductReviewResponseDTO21);2223await sdk.admin.productReviews.deleteResponse(24 productReviewId: string25);
Creation: Reviews are set to:
Moderation: Admins can:
IMPORTANT: A running PostgreSQL instance is required. The plugin expects and environment variables to be set. If not provided, both default to "postgres".
Available scripts:
1# Build the plugin2yarn build34# Development mode with hot-reload5yarn dev67# Publish to local registry for testing8yarn dev:publish910# Generate database migrations11yarn db:generate
After publishing the plugin locally by running yarn dev:publish, go to the root of your Medusa project and run the following commands:
1cd path/to/your/medusa-application23yarn medusa plugin:add @lambdacurry/medusa-product-reviews45# If you are yarn with a monorepo, you may also need to run6yarn install
This plugin is compatible with versions of .
MIT License