Docs
Medusa plugins
P

Plugin product reviews

Product Reviews Plugin for Medusa

Need customizations for this plugin?

Get in touch
npm install @devx-commerce/plugin-product-reviews
Category
other
Built by
devx-commerce
Type
unknown
Last updated
4 weeks ago

Features

  • Product review management
  • Review submission and moderation
  • Integration with Medusa admin dashboard
  • Customizable review settings
  • Review workflow management
  • Review response system
  • Review statistics and analytics
  • Image attachments for reviews
  • Rating system (1-5 stars)
  • Review status management (pending, approved, flagged)

Technical Overview

Data Models

The plugin implements three main data models:

  1. Product Review

    • Basic review information (name, email, rating, content)
    • Product and order associations
    • Image attachments
    • Review status (pending/approved/flagged)
    • Order line item reference
  2. Product Review Response

    • Store owner responses to reviews
    • Response content and metadata
  3. Product Review Stats

    • Aggregated statistics for products
    • Review counts
    • Average ratings
    • Rating distribution (1-5 stars)

Core Functionality

  • Review Management

    • Create, update, and delete reviews
    • Moderate review status
    • Attach images to reviews
    • Respond to customer reviews
  • Statistics and Analytics

    • Automatic calculation of product review statistics
    • Rating distribution tracking
    • Average rating computation
    • Review count tracking
  • Configuration Options

    • Default review status (pending/approved/flagged)
    • Customizable review workflow
    • Integration with Medusa's admin interface

Database Features

  • Optimized indexes for product and order lookups
  • Efficient statistics calculation using SQL aggregation
  • Support for review search functionality
  • Relationship management between reviews and products

Prerequisites

  • Node.js >= 20
  • Medusa v2.4.0 or higher
  • PostgreSQL database

Installation

  1. Install the plugin:
npm install @devx-commerce/product-reviews
# or
yarn add @devx-commerce/product-reviews
  1. Add the plugin to your :
const plugins = [
// ... other plugins
{
resolve: "@devx-commerce/product-reviews",
options: {
defaultReviewStatus: "approved", // or "pending" or "flagged"
},
},
];

API Endpoints

Admin API

Product Reviews

  • - List all product reviews
    • Query parameters:
      • : Fields to include in response
      • : Filter criteria
      • : Number of items per page
      • : Page offset

Product Review Stats

  • - List all product review statistics
    • Query parameters:
      • : Fields to include in response
      • : Filter criteria
      • : Number of items per page
      • : Page offset

Store API

Product Reviews

  • - List all product reviews
    • Query parameters:
      • : Fields to include in response
      • : Filter criteria
      • : Number of items per page
      • : Page offset
  • - Create or update product reviews
    • Request body:
      {
      reviews: Array<{
      id?: string;
      name?: string;
      email?: string;
      rating: number;
      content?: string;
      order_line_item_id?: string;
      product_id?: string;
      order_id?: string;
      images?: string[];
      }>;
      }

Product Review Stats

  • - List all product review statistics
    • Query parameters:
      • : Fields to include in response
      • : Filter criteria
      • : Number of items per page
      • : Page offset

Response Format

All list endpoints return data in the following format:

{
data: T[], // Array of items
count: number, // Total count of items
offset: number, // Current page offset
limit: number // Items per page
}

License

MIT

Medusa - Plugin product reviews