Skip to main content
Skip to main content

Product Module Overview

the Product Module is the @medusajs/product NPM package that provides product-related features in your Medusa and Node.js applications. It can be used to store products with variants, organize them into categories and collections, and more.

Features

Products Management

With the Product Module, you can store products and manage them through the main interface methods. Products can have custom options, such as color or size, and each variant in the product sets the value for these options.

const products = await productService.create([
{
title: "Medusa Shirt",
options: [
{
title: "Color",
},
],
variants: [
{
title: "Black Shirt",
options: [
{
value: "Black",
},
],
},
],
},
])

Product Organizations

the Product Module provides different entities that can be used to organize products, including categories, collections, tags, and more.

const category = await productService.createCategory({
name: "Shirts",
})

const products = await productService.update([
{
id: product.id,
categories: [
{
id: category.id,
},
],
},
])

How to Use the Product Module

The Product Module can be used in many use cases, including:

  • Medusa Backend: The Medusa backend uses the Product Module to implement some product features. However, it's guarded by the experimental feature flag. If you want to use the Product Module in your backend's customizations, follow this installation guide.
  • Serverless Application: Use the Product Module in a serverless application, such as a Next.js application, without having to manage a fully-fledged ecommerce system. You can use it by installing it in your Node.js project as an NPM package.
  • Node.js Application: Use the Product Module in any Node.js application. Follow this guide to learn how to install it.

Up Next

Was this section helpful?