npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@o2s/medusa-plugin-assets-services

v1.0.0

Published

Manage customer-linked product instances, service subscriptions and product relations.

Downloads

4

Readme

Medusa Assets & Services Plugin

A Medusa.js plugin for managing customer-linked product instances and service subscriptions.

Overview

The assets-services plugin extends Medusa with the ability to manage physical product instances (assets) and related service subscriptions (service instances) linked to individual customers. It supports a wide range of after-sales and post-purchase use cases, such as:

  • Assigning products (with serial numbers) to customers
  • Attaching services to assets (e.g. maintenance plans, insurance, calibration)
  • Selling standalone services (e.g. rentals, diagnostics)
  • Managing product relationships (e.g. compatible services, spare parts)

The plugin enhances the Medusa admin interface with new panels for managing assets, services, and product references, enabling rich linking and management flows.

This plugin is used in Open Self Service, a composable customer portal for viewing and managing owned products, warranties, and activating additional services. You can also use the plugin independently.

Installation

  1. Install plugin package

    yarn add @o2s/medusa-plugin-assets-services
  2. Register plugin in medusa-config.js

     ...
     plugins: [
         {
             resolve: "@o2s/medusa-plugin-assets-services",
             options: {}
         }
     ]
     ...
  3. Run DB migrations - This plugin introduces new models in database so you need to execute db migration

     npx medusa db:migrate

Features

Asset Management

  • Register purchased product instances per customer
  • Track serial numbers, warranty dates, and installation addresses
  • Link to product variants and optionally store thumbnails

Service Instance Management

  • Create/manage service subscriptions (linked to assets or standalone)
  • Supports various billing models: one-time, weekly, monthly, yearly
  • Statuses: Active / Inactive / Retired

Product References

  • Define references such as:
    • SPARE_PART
    • COMPATIBLE_SERVICE
  • Easily attach compatible services or accessories

Admin Interface Extensions

  • Adds new admin menu entries:
    • Assets
    • Services
  • Adds a new component on the product variant page to manage product references
  • "Deep-linking" between assets, services, and products

Compatibility

  • Medusa version >= 2.4.0

Known Issues

  • Unlinking the last asset from a service instance currently fails.

Used In: Open Self Service

Although this plugin is generic and can be used independently, it was developed to power one of core backend functionalities of Open Self Service, a frontend portal that allows customers to:

  • Browse and manage their purchased assets
  • Check product status and warranty
  • View and activate compatible service plans

Explore the Open Self Service project to see how this plugin supports real-world industrial self-service scenarios.

Docs

You can find admin API definition in repo files.

Models schema

Services & Assets

---
  config:
    class:
      hideEmptyMembersBox: true
---
classDiagram
    ServiceInstance --> PaymentTypeEnum : 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 PaymentTypeEnum{
        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
    }