Product Reviews
Enhance product reviews with advanced features
@nakamotosbutt/medusa-product-reviews-enhanced
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.
Features
See a demo in our Medusa Starter
- Product reviews with ratings (1-5 stars)
- Review statistics and analytics
- Review moderation workflow (Copy to clipboard
approved/Copy to clipboardpending/Copy to clipboardflagged) - Admin response management
- SDK for Store and Admin operations
- Enhanced Admin UI with:
- Advanced filtering (product, status, rating, date range, search)
- Pagination with customizable page size
- Direct page navigation
- Bulk operations support
- Dark theme integration with Medusa UI
- Improved API with:
- Full-text search across reviews
- Date range filtering
- Rating-based filtering
- Product-specific filtering
Prerequisites
Installation and Configuration
- Install the plugin:
1234yarn add @lambdacurry/medusa-product-reviews# or, if you're using yarn workspacesyarn workspace my-app add @lambdacurry/medusa-product-reviews
- Add to Copy to clipboard
medusa-config.ts:
12345678910module.exports = defineConfig({plugins: [{resolve: '@lambdacurry/medusa-product-reviews',options: {defaultReviewStatus: 'pending', // OPTIONAL, default is 'approved'},},],});
- Run migrations:
1yarn medusa db:migrate
Using the Plugin SDK
The plugin provides a built-in SDK for both store and admin operations using Medusa's native HTTP client.
Store Operations
1234567891011121314151617// List product reviewsconst { reviews, count } = await sdk.store.productReviews.list(query: StoreListProductReviewsQuery,headers?: ClientHeaders);// Create/Update a reviewconst review = await sdk.store.productReviews.upsert(data: StoreUpsertProductReviewsDTO,headers?: ClientHeaders);// Get review statisticsconst stats = await sdk.store.productReviews.listStats(query: StoreListProductReviewStatsQuery,headers?: ClientHeaders);
Admin Operations
1234567891011121314151617181920// List reviewsconst { reviews, count } = await sdk.admin.productReviews.list(query: AdminListProductReviewsQuery);// Update review statusconst review = await sdk.admin.productReviews.updateStatus(productReviewId: string,status: 'pending' | 'approved' | 'flagged');// Manage review responsesconst review = await sdk.admin.productReviews.createResponse(productReviewId: string,data: AdminCreateProductReviewResponseDTO);await sdk.admin.productReviews.updateResponse(productReviewId: string,data: AdminUpdateProductReviewResponseDTO
Review Workflow
- Creation: Reviews are set to:
- Copy to clipboard
approvedstatus by default - Copy to clipboard
pendingstatus if Copy to clipboarddefaultReviewStatus: 'pending'is set in plugin options
- Copy to clipboard
- Moderation: Admins can:
- List and filter reviews
- Update review status (approve/flag)
- Manage responses (create/update/delete)
Available Endpoints
Admin Endpoints
- Copy to clipboard
GET /admin/product-reviews- List all reviews - Copy to clipboard
POST /admin/product-reviews/:id/response- Add a response - Copy to clipboard
PUT /admin/product-reviews/:id/response- Update response - Copy to clipboard
DELETE /admin/product-reviews/:id/response- Delete response - Copy to clipboard
PUT /admin/product-reviews/:id/status- Update status
Store Endpoints
- Copy to clipboard
GET /store/product-reviews- List reviews - Copy to clipboard
POST /store/product-reviews- Create/Update review - Copy to clipboard
GET /store/product-review-stats- Get statistics
Local Development
IMPORTANT: A running PostgreSQL instance is required. The plugin expects Copy to clipboardDB_USERNAMEand Copy to clipboardDB_PASSWORDenvironment variables to be set. If not provided, both default to "postgres".
Available scripts:
1234567891011# Build the pluginyarn build# Development mode with hot-reloadyarn dev# Publish to local registry for testingyarn dev:publish# Generate database migrationsyarn db:generate
Installing the plugin in your Medusa project for local development
After publishing the plugin locally by running yarn dev:publish, go to the root of your Medusa project and run the following commands:
123456cd path/to/your/medusa-applicationyarn medusa plugin:add @lambdacurry/medusa-product-reviews# If you are yarn with a monorepo, you may also need to runyarn install
Compatibility
This plugin is compatible with versions Copy to clipboard>= 2.5.0 of Copy to clipboard@medusajs/medusa.
License
MIT License


