docs: change config snippets to use defineConfig (#7546)

This commit is contained in:
Shahed Nasser
2024-05-30 16:47:28 +03:00
committed by GitHub
parent ddfd757277
commit fe96bd39b1
51 changed files with 489 additions and 718 deletions
@@ -15,15 +15,21 @@ In this document, you'll learn about the options of the User Module.
## Module Options
```js title="medusa-config.js"
const modules = {
const { Modules } = require("@medusajs/modules-sdk")
// ...
module.exports = defineConfig({
// ...
user: {
resolve: "@medusajs/user",
options: {
jwt_secret: process.env.JWT_SECRET,
modules: {
[Modules.USER]: {
resolve: "@medusajs/user",
options: {
jwt_secret: process.env.JWT_SECRET,
},
},
},
}
}
})
```
<Table>
@@ -39,26 +39,6 @@ await userModuleService.refreshInviteTokens([invite.id])
## Configure User Module
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 = {
// ...
[Modules.USER]: {
resolve: "@medusajs/user",
options: {
jwt_secret: process.env.JWT_SECRET ?? "supersecret",
},
},
}
```
### Module Options
Refer to [this documentation](./module-options/page.mdx) for details on the module's options.
---