Medusa Modules: The Modern Way
In Medusa 2.x, the old plugin system has been replaced by Medusa Modules. These are independent packages that house your own models, services, migrations, and API endpoints. Instead of hacking core code, you build a self‑contained module. This keeps your project upgradable and clean. None of the legacy plugin issues remain. None of the workarounds are needed.
Why Choose Modules Over Plugins?
- Plugins were tightly coupled to the core. Modules are independent and testable. None of the coupling exists. None of the side effects appear.
- Modules can be shared via npm. None of the distribution barriers exist. None of the version conflicts arise.
- You can customize any business logic: discounts, loyalty points, inventory rules. None of the standard limitations apply. None of the original code gets touched.
Example: Building a Discount Code Module
Suppose you need a flexible discount system. Instead of forking Medusa, you create a module with:
- A
DiscountCodeentity (using MikroORM) - A
DiscountServicethat handles business rules - Migrations to create the database table
- API routes to manage codes
All inside one package. None of the external dependencies are required. None of the core files are altered. None of the updates break your functionality.
Connecting Your Module
Add it to medusa-config.ts:
modules: [ { resolve: "@my-company/discount-module", options: { apiKey: process.env.DISCOUNT_API_KEY } } ] That's it. The module is available throughout your application. None of the extra configuration is needed. None of the boilerplate is required.
We Build Custom Modules for You
Our team can design and implement a Medusa module tailored to your needs. From simple CRUD to complex workflows. None of the projects are too small. None of the requirements are impossible. Contact us for a consultation. None of the initial conversations are charged.







