Skip to main content
Skip to main content

Install Product Module in Medusa

In this document, you'll learn how to install the Product Module using NPM in the Medusa backend.

Step 1: Install Module

To install the Product Module, run the following command in the root directory of the Medusa backend:

npm install @medusajs/product

Step 2: Add Module to Configurations

In medusa-config.js, add the Product Module to the exported object under the modules property:

module.exports = {
// ...
modules: {
// ...
productService: {
resolve: "@medusajs/product",

Step 3: Run Migrations

Run the following command to reflect schema changes into your database:

npx medusa migrations run

Use the Module

You can now start using the module's ProductModuleService by resolving it through dependency injection.

For example:

import type { 
} from "@medusajs/medusa";
import {
} from "@medusajs/product"

export async function GET(
req: MedusaRequest,
res: MedusaResponse
) {
const productModuleService: ProductModuleService =

return res.json({
products: productModuleService.list()

Start Development

You can refer to the Example Usages documentation page for examples of using the Product Module.

You can also refer to the Module Interface Reference for a detailed reference on all available methods.

Was this section helpful?