Skip to main content

📝 Listing Product Reviews

This guide explains how to list product reviews using the Alphabite Reviews Plugin. You can list all reviews or reviews for a specific product.


✅ Prerequisites

  • A Medusa backend with the Reviews plugin installed and configured.
  • Existing reviews in your system.

🔨 Step-by-Step Implementation

1. List All Reviews

To retrieve a list of all reviews, use the list endpoint.

const { reviews, count, limit, offset } = await sdk.alphabite.reviews.list({
limit: 10,
offset: 0,
// Add filters as needed, e.g., product_ids: ["prod_123"]
});

console.log(reviews);

2. List Reviews for a Specific Product

To retrieve reviews for a particular product, use the listProductReviews endpoint.

const { reviews, count, limit, offset } = await sdk.alphabite.reviews.listProductReviews({
product_id: "prod_...",
limit: 10,
offset: 0,
// Add filters as needed, e.g., rating: 5
});

console.log(reviews);
API Reference

Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper 🔗

You can view the full endpoint documentation for:


📝 Notes

  • Both list and listProductReviews endpoints support pagination and various filtering options.
  • You can include product details in the response by setting include_product: true.