Skip to main content

🚀 Usage

This guide explains how to retrieve product collection images using the Medusa SDK. The Product Collection Images plugin integrates natively with Medusa's existing data fetching mechanisms, so no additional API endpoints are required on the storefront.


1. Retrieve Product Collection with Images​

To include product collection images when fetching a product collection, simply add product_collection_images to the fields array in your SDK call.

const retrievedCollection = await sdk.store.collection.retrieve("prod_col_id", {
fields: ["id", "title", "product_collection_images"],
});

2. List Product Collections with Images​

To include product collection images when listing product collections, add product_collection_images to the fields array in your SDK call.

const collectionsList = await sdk.store.collection.list({
fields: ["id", "title", "product_collection_images"],
});