📦 Installation
This guide walks you through installing and configuring the Alphabite Reviews Plugin in your Medusa backend.
1. Install the Plugin​
Install the package via npm:
npm install @alphabite/medusa-reviews
2. Register the Plugin​
Add the plugin to your medusa.config.ts
or medusa-config.js
:
import { ReviewsPluginOptions } from "@alphabite/medusa-reviews";
export default {
plugins: [
{
resolve: "@alphabite/medusa-reviews",
options: {
// Add any specific options for the reviews plugin here if available
} satisfies ReviewsPluginOptions,
},
],
};
3. Run Database Migrations​
The plugin adds new tables to support reviews. Run the migration after registration:
npx medusa migration run
4. Plugin Options​
Option | Type | Default | Description |
---|---|---|---|
allowOnlyVerifiedPurchases | boolean | false | Allows only customers with a verified purchase to leave a review |
allowMultipleReviewsPerProduct | boolean | true | Allows multiple reviews per product from the same customer |
enableImageUploads | boolean | true | Enables image uploads for reviews |
maxImageSize | number | 5242880 (5MB) | Maximum allowed size for review images in bytes |
allowedImageMimeTypes | string[] | ["image/jpeg", "image/png", "image/webp"] | Allowed MIME types for review images |
5. Environment Variables (Optional)​
You can use environment variables for configuration if preferred:
// Example:
// allowUnverifiedReviews: process.env.REVIEWS_ALLOW_UNVERIFIED === "true",
✅ Compatibility​
- Requires Medusa v2
- Adds database tables (migration required)
- Compatible with both JS and TypeScript projects
🚀 Next Step​
👉 Explore the REST API