docs: edits and fixes to commerce module docs (#7468)

Apply edits and fixes to the commerce modules docs
This commit is contained in:
Shahed Nasser
2024-05-29 11:08:06 +00:00
committed by GitHub
parent 130de74d6d
commit 2c5ba408d4
160 changed files with 6400 additions and 3790 deletions
@@ -8,8 +8,6 @@ export const metadata = {
The User Module is the `@medusajs/user` NPM package that provides user-related features in your Medusa and Node.js applications.
---
## Features
### User Management
@@ -41,15 +39,19 @@ await userModuleService.refreshInviteTokens([invite.id])
## Configure User Module
After installing the `@medusajs/user` package in your Medusa application, add it to the `modules` object in `medusa-config.js`:
To use the User Module, enable it in the `modules` object in `medusa-config.js`:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/modules-sdk")
// ...
const modules = {
// ...
user: {
[Modules.USER]: {
resolve: "@medusajs/user",
options: {
jwt_secret: process.env.JWT_SECRET,
jwt_secret: process.env.JWT_SECRET ?? "supersecret",
},
},
}
@@ -114,11 +116,14 @@ For example:
import { IUserModuleService } from "@medusajs/types"
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
const step1 = createStep("step-1", async (_, context) => {
const step1 = createStep(
"step-1",
async (_, { container }) => {
const userModuleService: IUserModuleService =
context.container.resolve(
container.resolve(
ModuleRegistrationName.USER
)
const users = await userModuleService.list()
})
```