@medusajs/store
Documentation | Website
Building blocks for digital commerce
Store Module for Medusa: manages stores and their supported currencies and locales. It's installed and registered by default with @medusajs/medusa, so Medusa applications use it through the Modules.STORE service rather than installing this package directly.
At a glance
| Package | @medusajs/store |
| Type | Commerce Module |
| Module key | Modules.STORE ("store") |
| Registered by default | Yes |
| Import from | @medusajs/medusa/store |
Installation
No installation needed. The module ships with @medusajs/medusa and is registered by defineConfig.
Usage
Resolve the module's service from the Medusa container, for example in a workflow step:
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
import { Modules } from "@medusajs/framework/utils"
const createStoreStep = createStep(
"create-store",
async ({}, { container }) => {
const storeModuleService = container.resolve(Modules.STORE)
const store = await storeModuleService.createStores({
name: "My Store",
supported_currencies: [{
currency_code: "usd",
is_default: true,
}],
})
return new StepResponse({ store }, store.id)
}
)