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

@techlabi/medusa-marketplace-plugin

v0.49.0

Published

A multi-vendor Medusa plugin

Readme

Medusa Multivendor Marketplace Plugin

This plugin transforms your Medusa store into a robust multivendor marketplace.

Background

The plugin was created as a result of a four-part series articles on Medium re how to create multivendor marketplace with Medusa 2.0:

  • 🛠 Part 1: setting up the multi-vendor structure and understanding how to manage multiple sellers on a single Medusa instance
  • 🧑‍💼 Part 2: building a powerful Super Admin layer to oversee vendors, products, orders, and more
  • 🎨 Part 3: customizing the Medusa Admin Dashboard to give super admins and vendors a clean, user-friendly experience
  • 🎨 Part 4: bring it all together - packaging everything into a Medusa 2 plugin

Features

  • Store Creation:
    • The plugin provides an intuitive interface for creating new vendor stores, simplifying the onboarding process for new sellers.
  • Entity Separation:
    • The plugin ensures that each store has its own independent set of entities (customers, orders, products, etc.), preventing data conflicts and ensuring privacy.
  • Impersonation:
    • Super admins can seamlessly switch between vendor accounts, enabling them to:
      • View the marketplace from a vendor's perspective.
      • Troubleshoot issues efficiently.
      • Provide personalized support.

Installation

  1. Add plugin:

    yarn add @techlabi/medusa-marketplace-plugin
  2. Add the following variables to your .env file:

    API_KEY=supersecret
    VITE_BACKEND_URL=http://localhost:9000
    • API_KEY - The secret key used to create the super admin.
    • VITE_BACKEND_URL - The URL of your Medusa backend, required for custom admin components.
  3. Apply postinstall patch:

    To ensure proper setup, follow these steps:

    1. Open package.json: Open the package.json file in your project's root directory.

    2. Add postinstall script: Add the following script under the scripts section:

      "scripts": {
        "postinstall": "node node_modules/@techlabi/medusa-marketplace-plugin/.medusa/server/src/patch-admin.js",
        // ... other scripts ...
      }
    3. Run installation: Execute the installation process using yarn:

      yarn

      This postinstall script will automatically execute after all dependencies are installed, applying the necessary patch.

  4. Add the following code to your medusa-config.ts file:

    module.exports = defineConfig({
      projectConfig: { ... },
      plugins: [
        {
          resolve: "@techlabi/medusa-marketplace-plugin",
          options: {},
        },
      ],
    })

    This code connect plugin and helps to resolve an issue similar to https://github.com/medusajs/medusa/issues/11248.

  5. Run database migrations:

    npx medusa db:migrate
  6. Start the project:

    yarn dev

Envs

  • ALLOW_API_KEYS_FOR_VENDORS=true - allow API keys management for regular vendors
  • __VITE_DISABLE_SIGNUP_WIDGET__ - to disable signup widget on login page. Must be configured via vite config config.define["__VITE_DISABLE_SIGNUP_WIDGET__"] = JSON.stringify(true);

Demo app

https://github.com/Tech-Labi/medusa2-marketplace-demo

Functionality Overview

Key features included:

  • Super Admin Role:
    • Introduces a super admin role with the ability to manage all aspects of the marketplace.
    • Super admins can:
      • Create and manage multiple vendor stores.
      • Impersonate vendor accounts to troubleshoot and provide support.
      • Access and analyze data across all stores.
  • Vendor Store Management:
    • Enables the creation of individual vendor stores, each with its own:
      • Customer Base: Independent customer lists for each vendor.
      • Order Management: Separate order tracking and fulfillment.
      • Price Lists: Unique pricing strategies for each vendor.
      • Product Catalogs: Distinct product offerings per store.
      • Shipping Profiles: Tailored shipping options.
      • Stock Locations: Independent inventory management.
      • User Accounts: Vendor-specific user management.
  • Data Separation:
    • The plugin ensures clear separation of data between stores using Medusa's module links:
      • customer-store.ts
      • order-store.ts
      • price-list-store.ts
      • product-store.ts
      • shipping-profile-store.ts
      • stock-location-store.ts
      • user-store.ts
    • This architecture allows vendors to operate independently while maintaining a cohesive marketplace experience for customers.

Creating a Super Admin

To create a super admin, use the following curl request:

curl -X POST http://localhost:9000/stores/super -d '{ "email":"[email protected]", "password": "supersecret"}' -H 'Content-Type: application/json' -H 'Authorization: supersecret'

Contributing

Feel free to contribute to this plugin by submitting pull requests or creating issues for bug reports and feature requests.

License

Apache 2.0