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

medusa-plugin-extended-products

v0.0.33

Published

A medusa.js plugin for a small adjustments and extensions of currently used product entity and a new API endpoints

Downloads

52

Readme

medusa-plugin-extended-products

A Medusa.js plugin that extends default product functionality with additional features like popularity tracking, sorting, filtering, and advanced pagination. For now the only available language of UI is Ukrainian, but translations are in development.

Medusa Website | Medusa Repository

Features

  • Extended product information (visits, orders, wishlists)
  • Advanced sorting options (newest, popular, price)
  • Smart pagination with available/unavailable products handling
  • Category-based filtering
  • Product popularity tracking
  • Availability status tracking
  • Support for product metadata (properties, videos)
  • Performance-optimized querying
  • Easy integration with existing Medusa stores
  • Custom product properties management via Admin UI
  • Rich text description editor with Markdown support
  • Structured product information fields:
  1. Nutritional values
  2. Storage conditions
  3. Product specifications
  4. Country of origin
  5. Packaging details
  6. Warnings/Precautions
  7. Special features

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

yarn add medusa-plugin-extended-products

2. In medusa-config.js add the following configuration:

const plugins = [
  // ...
  {
    resolve: `medusa-plugin-extended-products`,
    options: {
      enableUI: true,
    },
  },
]

Extended Product Model

The plugin extends the default Medusa Product model with additional fields:

interface ExtendedProduct extends Partial<Product> {
  videos: string[];           // Array of video URLs
  properties: Property[];     // Custom product properties
  visits: number;            // View count
  orders: number;            // Number of orders
  wishlisted: number;        // Times added to wishlists
  popularity: number;        // Calculated popularity score
  state: 'available' | 'unavailable'; // Availability state
}

REST API Endpoints

Store Endpoints:

  1. /store/products/extended:
  • GET with query parameters:
    • page: Page number (default: 1)
    • count: Items per page (default: 20)
    • sort: Sorting type ('newest', 'popular', 'cheap', 'expensive')
    • available: Filter by availability ('true', 'false')
    • categories: Category handles, comma-separated
  • Returns:
    {
      products: ExtendedProduct[],
      metadata: {
        total: number,
        pages: number,
        page: number,
        count: number
      }
    }
  1. /store/products/extended/[id]/views:
  • POST: Increments view count for specific product
  • Returns: Updated ExtendedProduct object

Sorting Options

  • newest: Products sorted by creation date
  • popular: Products sorted by popularity score (visits * 0.15 + orders * 0.65 + wishlisted * 0.20)
  • cheap: Products sorted by lowest variant price
  • expensive: Products sorted by highest variant price

Filtering

  • By availability: Show only available or unavailable products
  • By categories: Show products from specific categories (union of multiple categories)
  • Combined filtering: Apply both filters simultaneously

Pagination Features

  • Smart handling of available/unavailable products
  • Fills pages to requested count by adding unavailable products when needed
  • Proper counting and page calculation for partial results

Performance Considerations

The plugin implements several optimizations:

  • Batch data loading
  • Efficient filtering using Sets
  • Optimized database queries
  • Proper relation handling
  • Memory-efficient data processing

Usage Examples

// Get first page of 20 most popular products
GET /store/products/extended?sort=popular&page=1&count=20

// Get cheap products from specific categories
GET /store/products/extended?sort=cheap&categories=dried-fruits,nuts

// Get only available products
GET /store/products/extended?available=true

// Increment product views
POST /store/products/extended/prod_123/views

Homepage