import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const reviewListResponse of client.reviews.list({ product_id: 'prod_xxxxxxxxxxxxx' })) {
console.log(reviewListResponse.id);
}{
"data": [
{
"id": "rev_xxxxxxxxxxxxxx",
"title": "Amazing community and tools",
"description": "Great product, really helped me grow my audience.",
"stars": 42,
"status": "pending",
"paid_for_product": true,
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"published_at": "2023-12-01T05:00:00.401Z",
"joined_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"attachments": [
{
"id": "<string>",
"filename": "document.pdf",
"content_type": "image/jpeg",
"url": "https://media.whop.com/abc123/optimized.jpg"
}
]
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}Returns a paginated list of customer reviews for a specific product, with optional filtering by star rating and creation date.
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const reviewListResponse of client.reviews.list({ product_id: 'prod_xxxxxxxxxxxxx' })) {
console.log(reviewListResponse.id);
}{
"data": [
{
"id": "rev_xxxxxxxxxxxxxx",
"title": "Amazing community and tools",
"description": "Great product, really helped me grow my audience.",
"stars": 42,
"status": "pending",
"paid_for_product": true,
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"published_at": "2023-12-01T05:00:00.401Z",
"joined_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"attachments": [
{
"id": "<string>",
"filename": "document.pdf",
"content_type": "image/jpeg",
"url": "https://media.whop.com/abc123/optimized.jpg"
}
]
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
42
Returns the last n elements from the list.
42
The unique identifier of the product to list reviews for.
"prod_xxxxxxxxxxxxx"
The minimum star rating to include in results, from 1 to 5 inclusive.
42
The maximum star rating to include in results, from 1 to 5 inclusive.
42
Only return reviews created before this timestamp.
"2023-12-01T05:00:00.401Z"
Only return reviews created after this timestamp.
"2023-12-01T05:00:00.401Z"
Was this page helpful?