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 authored and GitHub committed 2024-05-29 11:08:06 +00:00
1 parent 130de74d6d
commit 2c5ba408d4
160 files changed
+6400 -3790

No files matched your search

@@ -8,4 +8,10 @@ export const metadata = {
Find in this reference the list of events emitted by the User Module.
<Note type="soon">
Events are still in development, so this reference will change in the future.
</Note>
<EventsTable />
@@ -408,4 +408,4 @@ In this guide, you’ll find common examples of how you can use the User Module
## More Examples
The [module interface reference](/references/user) provides a reference to all the methods available for use with examples for each.
The [User Module's main service reference](/references/user) provides a reference to all the methods available for use with examples for each.
@@ -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()
})
```
@@ -4,7 +4,7 @@ export const metadata = {
# {metadata.title}
This document provides some possible flows to create a user.
This document provides flows to create a user.
## Using the Auth Module
@@ -50,7 +50,7 @@ await userModuleService.refreshInviteTokens(["invite_123"])
## Straightforward Creation
Finally, you can create a user using the `create` method of the User Module’s main service (`IUserModuleService`):
Finally, you can create a user using the [create method of the User Module’s main service](/references/user/create):
```ts
const user = await userModuleService.create({