Плагины Medusa
P

Product reviews enhanced

Enhanced Product Reviews Plugin for Medusa with advanced filtering, pagination and admin UI

Нужна доработка этого плагина?

Связаться с нами
npm install @nakamotosbutt/medusa-product-reviews-enhanced
Категория
other
Создано
nakamotosbutt
Тип
unknown
Последнее обновление
2 месяца назад
Звезды на Github
17

@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 (//)
  • 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

  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 :
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:

    • status by default
    • status if 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

  • - List all reviews
  • - Add a response
  • - Update response
  • - Delete response
  • - Update status

Store Endpoints

  • - List reviews
  • - Create/Update review
  • - Get statistics

Local Development

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:

# 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 of .

License

MIT License

Medusa - Product reviews enhanced