medusa
The Medusa v2 engine for Evolve: modules that serve the
same GraphQL contract as @evolve-framework/commercetools from Medusa's Store
API, so a storefront cannot tell which engine is behind the graph.
When to use
Use it when Medusa is your commerce engine. A service composes the modules it
needs, from CatalogModule and CartModule to orders, payments, customers,
business units, quotes, order approvals and shopping lists. It reads the Store
API with a publishable key only and holds no admin credentials. It is the
counterpart of the commercetools and SFCC engines, so a service uses exactly
one of them.
Get started
Install the package with the peer dependencies it needs. It comes from the Evolve registry, which needs a one-time sign-in.
pnpm add @evolve-framework/medusa @evolve-framework/core @labdigital/federated-token fastify graphql zodRequirements7
@evolve-framework/core>= 1.8.0 < 2.0.0@labdigital/federated-token>= 3.0.0 < 4.0.0@types/node>=22optionalfastify>= 5.12.1 < 6.0.0graphql>= 16.0.0 < 17.0.0msw^2.14.6 || ^3.0.1optionalzod>= 4.4.0 < 5.0.0
For example:
import { CompositeModule } from "@evolve-framework/core";import { ClientFactory, getClientOptions, MedusaConfig,} from "@evolve-framework/medusa";import { CartModule, CatalogModule } from "@evolve-framework/medusa/modules";
const config = await MedusaConfig.load();const clientFactory = new ClientFactory();clientFactory.configure(getClientOptions(config));
const module = new CompositeModule([new CatalogModule(), new CartModule()]);Modules
| Module | Serves | Required options |
|---|---|---|
AuthModule | Authentication | – |
BusinessUnitModule | Business units | – |
CartModule | Cart | – |
CatalogModule | Catalog | – |
CheckoutModule | Checkout | – |
CustomerModule | Customer | – |
DeliveryOptionsModule | Delivery options | provider |
EventsModule | The route @evolve-framework/medusa-plugin-events posts to, publishing the shared product and category events for what it forwards, so a CMS and a search index follow a Medusa catalog as they follow commercetools. | clientFactory, messagePublisher, origin |
GiftCardModule | Gift card | – |
InvoiceModule | Invoice | – |
MultipleCartModule | Multiple carts | – |
OrderApprovalModule | Order approval | – |
OrderModule | Order | – |
PaymentModule | Payment | – |
QuoteModule | Quote | – |
ShoppingListModule | Shopping lists | – |
Adapters
| Adapter | What it is | Required options |
|---|---|---|
MedusaSearchQueryAdapter | Product search answered by Medusa's own Search module, through POST /store/search, against the index @evolve-framework/medusa-plugin-search declares. | – |
Configuration
MedusaConfig reads 3 environment variables. See which
Testing
Test helpers in /cleanup, /testing. What they are for
Commands
Installing this package adds these commands to the evolve CLI.
evolve cleanup: Development only. Delete what end-to-end runs left behind
Entry points
@evolve-framework/medusa | The Medusa client and its configuration, the request context, error mapping and slug helpers.40 exports |
@evolve-framework/medusa/dataloaders | The request-scoped dataloaders the modules read products, categories and slugs through.5 exports |
@evolve-framework/medusa/modules | The modules: auth, business units, cart, catalog, checkout, customers, orders, order approvals, payments, quotes and shopping lists, and the route that turns Medusa's catalog events into internal events.16 exports |
@evolve-framework/medusa/search | The product source a search index is built from, and a search provider for the catalog.4 exports |
@evolve-framework/medusa/sitemap | The product source for sitemap generation.1 export |
@evolve-framework/medusa/cleanup | Test-data cleanup through Medusa's admin API, for the command line and a test-support service.8 exports |
@evolve-framework/medusa/testing | A test client and mocked Store API handlers, for testing against Medusa without a server.5 exports |

