What problem does it solve?
Enable engineers to extend Medusa.js backends with modular services, event subscribers, workflows, and custom API endpoints so business rules, integrations, and side-effectful processes are implemented reliably and maintainably.
Core Features & Use Cases
- Custom module and service patterns using MedusaService and model.define for persistent domain logic and CRUD generation.
- Event subscribers that re-fetch entities and trigger workflows for integration tasks such as notifying 3PLs, awarding loyalty points, or syncing with ERPs.
- Custom storefront and admin API routes that use req.scope resolution, Zod validation, and clear HTTP method handlers.
- Workflow design with compensation functions, scheduled jobs, and best practices for migrations, DI container resolution, and admin UI extensions.
- Use case examples: a loyalty points module with subscribers and workflows, a scheduled job to expire points, and a custom payment provider module handling webhooks.
Quick Start
Create a Medusa v2 project, register a module in medusa-config.ts, add a subscriber that resolves services from the container, and implement a workflow step with a compensation function to handle side effects.