npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lambdacurry/medusa-product-reviews

v1.3.0

Published

Product Reviews Plugin for Medusa

Downloads

1,610

Readme

@lambdacurry/medusa-product-reviews

A plugin that adds product review and moderation capabilities to your Medusa application, with built-in admin responses and review statistics.

This plugin is part of the Medusa Plugins Collection.

Features

See a demo in our Medusa Starter

  • Product reviews with ratings
  • Review statistics and analytics
  • Review moderation workflow (approved/pending/flagged)
  • Admin response management
  • SDK for Store and Admin operations

Prerequisites

Installation and Configuration

  1. Install the plugin:
yarn add @lambdacurry/medusa-product-reviews

# or, if you're using yarn workspaces
yarn workspace my-app add @lambdacurry/medusa-product-reviews
  1. Add to medusa-config.ts:
module.exports = defineConfig({
  plugins: [
    {
      resolve: '@lambdacurry/medusa-product-reviews',
      options: {
        defaultReviewStatus: 'pending', // OPTIONAL, default is 'approved'
      },
    },
  ],
});
  1. Run migrations:
yarn medusa db:migrate

Using the Plugin SDK

For detailed SDK setup and configuration, refer to the @lambdacurry/medusa-plugins-sdk README.

Store Operations

// List product reviews
const { reviews, count } = await sdk.store.productReviews.list(
  query: StoreListProductReviewsQuery,
  headers?: ClientHeaders
);

// Create/Update a review
const review = await sdk.store.productReviews.upsert(
  data: StoreUpsertProductReviewsDTO,
  headers?: ClientHeaders
);

// Get review statistics
const stats = await sdk.store.productReviews.listStats(
  query: StoreListProductReviewStatsQuery,
  headers?: ClientHeaders
);

Admin Operations

// List reviews
const { reviews, count } = await sdk.admin.productReviews.list(
  query: AdminListProductReviewsQuery
);

// Update review status
const review = await sdk.admin.productReviews.updateStatus(
  productReviewId: string,
  status: 'pending' | 'approved' | 'flagged'
);

// Manage review responses
const review = await sdk.admin.productReviews.createResponse(
  productReviewId: string,
  data: AdminCreateProductReviewResponseDTO
);

await sdk.admin.productReviews.updateResponse(
  productReviewId: string,
  data: AdminUpdateProductReviewResponseDTO
);

await sdk.admin.productReviews.deleteResponse(
  productReviewId: string
);

Review Workflow

  1. Creation: Reviews are set to:

    • approved status by default
    • pending status if defaultReviewStatus: 'pending' is set in plugin options
  2. Moderation: Admins can:

    • List and filter reviews
    • Update review status (approve/flag)
    • Manage responses (create/update/delete)

Available Endpoints

Admin Endpoints

  • GET /admin/product-reviews - List all reviews
  • POST /admin/product-reviews/:id/response - Add a response
  • PUT /admin/product-reviews/:id/response - Update response
  • DELETE /admin/product-reviews/:id/response - Delete response
  • PUT /admin/product-reviews/:id/status - Update status

Store Endpoints

  • GET /store/product-reviews - List reviews
  • POST /store/product-reviews - Create/Update review
  • GET /store/product-review-stats - Get statistics

Local Development

IMPORTANT: A running PostgreSQL instance is required. The plugin expects DB_USERNAME and DB_PASSWORD environment variables to be set. If not provided, both default to "postgres".

Available scripts:

# Build the plugin
yarn build

# Development mode with hot-reload
yarn dev

# Publish to local registry for testing
yarn dev:publish

# Generate database migrations
yarn 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:

cd path/to/your/medusa-application

yarn medusa plugin:add @lambdacurry/medusa-product-reviews

# If you are yarn with a monorepo, you may also need to run
yarn install

Compatibility

This plugin is compatible with versions >= 2.5.0 of @medusajs/medusa.

License

MIT License