@medusajs/medusa
v2.22.7
Published
Building blocks for digital commerce
Keywords
Readme
@medusajs/medusa is the core Medusa application package: the commerce server with its Store, Admin, and Auth API routes, the implementations of the medusa CLI commands, and all default commerce and infrastructure modules. Every Medusa application depends on it, and modules are registered from it by their @medusajs/medusa/<module> path (for example, @medusajs/medusa/cart).
At a glance
| | |
| --- | --- |
| Package | @medusajs/medusa |
| Type | Core library |
| Import from | @medusajs/medusa/<module> for modules and providers, @medusajs/medusa/core-flows for workflows |
| Entry points | ./<module>, ./core-flows, ./api/*, ./commands/*, ./subscribers/*, ./jobs/*, ./loaders/*, ./feature-flags/*, ./types, ./utils |
Features
- Commerce server: Express-based HTTP server with the Store API (
/store), Admin API (/admin), Auth API (/auth), and webhook routes (/hooks). - CLI commands: implementations of
develop,start,build,exec,user,lint,db:*, andplugin:*, run through themedusabinary from@medusajs/cli. - Default modules: re-exports every official module and provider (Cart, Product, Order, Payment, Auth, File, Event Bus, Workflow Engine, and more) at
@medusajs/medusa/<name>, so they need no separate install. - Workflows: re-exports
@medusajs/core-flowsat@medusajs/medusa/core-flows.
Installation
Create a new Medusa application, which installs this package along with @medusajs/framework and @medusajs/cli:
npx create-medusa-app@latest my-medusa-storeRequires Node.js >=22.22.0.
Usage
Register a module or provider shipped with this package by its @medusajs/medusa/<name> path in medusa-config.ts:
import { defineConfig } from "@medusajs/framework/utils"
module.exports = defineConfig({
projectConfig: {
databaseUrl: process.env.DATABASE_URL,
},
modules: [
{
resolve: "@medusajs/medusa/file",
options: {
providers: [
{
resolve: "@medusajs/medusa/file-s3",
id: "s3",
options: {
// ...
},
},
],
},
},
],
})Run the server with the Medusa CLI:
npx medusa develop