New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

product-relations-plugin

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

product-relations-plugin

A starter for Medusa plugins.

latest
npmnpm
Version
1.4.8
Version published
Maintainers
1
Created
Source

Medusa Services & Assets

Overview

The Product Relations Plugin for Medusa extends your e-commerce capabilities by adding dedicated entities to manage customer purchases and services more effectively. This plugin introduces two key concepts:

  • Assets: Track physical products with unique identifiers (like serial numbers) that customers have purchased
  • Service Instances: Manage services that can be either attached to assets (like extended warranties, maintenance plans) or exist independently (such as rentals, repairs, or standalone services)

Additionally, this plugin enhances product variants by allowing you to create references to other products, such as spare parts or replacements, making it easier to manage product relationships and accessories.

When plugin is installed, new menu options should appear in backoffice. There are dedicated pages to manage Service instances and Assets with ability to create, modify and delete them.

You can find admin API definition in repo files.

Compatibility

This starter is compatible with versions >= 2.4.0 of @medusajs/medusa.

Installation

  • Install plugin by adding to your package.json:
...
"product-relations-plugin": "^1.4.7"/ // or other available version
...
  • Execute install (yarn install)

  • Add plugin to uour medusa-config.js:

...
plugins: [
  {
    resolve: "product-relations-plugin",
    options: {}
  }
]
...
  • This plugin introduces new models in database so you need to execute migration:
npx medusa db:migrate

Known issues

  • Can't set empty list of assets on service instance. Unlinking item by item works but last one stays for unknown reason.

Models schema

Services & Assets

---
  config:
    class:
      hideEmptyMembersBox: true
---
classDiagram
    ServiceInstance --> PaymenntTypeEnum : has
    ServiceInstance --> ServiceItemStatusEnum : has

    ServiceInstance "0..*" <--> "0..*" Asset

    ServiceInstance "1" --> "1" ProductVariant

    Asset "1" --> "1" Address

    Asset "1" --> "1" Customer

    ServiceInstance "1" --> "1" Customer

    Asset "1" --> "1" ProductVariant

    ProductVariant "1" --> "0..*" ProductReference

    ProductReference --> ProductVariant_

    class ServiceInstance{
        String name
        Date startDate
        Date endDate
        Date purchaseDate
        Price price
    }

    class PaymenntTypeEnum{
        ONE_TIME
        WEEKLY
        MONTHLY
        YEARLY
    }

    class ServiceItemStatusEnum{
        ACTIVE
        INACTIVE
        RETIRED
    }

    class Asset{
        String name
        String serialNumber
        String thumbnail
        Date endOfWarranty
    }

    class Address{
    }

    class ProductVariant{

    }

    class Customer{

    }

    class ProductReference{
        SPARE_PART
        COMPATIBLE_SERVICE
    }

Keywords

medusa

FAQs

Package last updated on 22 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts