Skip to content

Commit 89886ba

Browse files
authored
docs: general updates to documentation pages (medusajs#13128)
1 parent 522fc12 commit 89886ba

File tree

13 files changed

+126
-36
lines changed

13 files changed

+126
-36
lines changed

www/apps/book/app/learn/fundamentals/workflows/multiple-step-usage/page.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const metadata = {
2-
title: `${pageNumber} Multiple Step Usage in Workflow`,
2+
title: `${pageNumber} Multiple Step Usage in Workflows`,
33
}
44

55
# {metadata.title}
@@ -12,7 +12,7 @@ In some cases, you may need to use a step multiple times in the same workflow.
1212

1313
The most common example is using the `useQueryGraphStep` multiple times in a workflow to retrieve multiple unrelated data, such as customers and products.
1414

15-
Each workflow step must have a unique ID, which is the ID passed as a first parameter when creating the step:
15+
Steps must have a unique ID, which you pass as the first parameter of the `createStep` function.
1616

1717
```ts
1818
const useQueryGraphStep = createStep(
@@ -21,7 +21,7 @@ const useQueryGraphStep = createStep(
2121
)
2222
```
2323

24-
This causes an error when you use the same step multiple times in a workflow, as it's registered in the workflow as two steps having the same ID:
24+
So, when a step is used multiple times in a workflow, it's registered multiple times in the workflow with the same ID, which causes an error.
2525

2626
```ts
2727
const helloWorkflow = createWorkflow(
@@ -51,7 +51,7 @@ When you execute a step in a workflow, you can chain a `config` method to it to
5151

5252
Use the `config` method to change a step's ID for a single execution.
5353

54-
So, this is the correct way to write the example above:
54+
For example, this is the correct way to write the example above:
5555

5656
export const highlights = [
5757
["13", "name", "Change the step's ID for this execution."]
@@ -75,6 +75,6 @@ const helloWorkflow = createWorkflow(
7575
)
7676
```
7777

78-
The `config` method accepts an object with a `name` property. Its value is a new ID of the step to use for this execution only.
78+
The `config` method accepts an object with a `name` property. Its value is the new ID for the step to use for this execution only.
7979

8080
The first `useQueryGraphStep` usage has the ID `use-query-graph`, and the second `useQueryGraphStep` usage has the ID `fetch-customers`.

www/apps/book/generated/edit-dates.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const generatedEditDates = {
9595
"app/learn/fundamentals/environment-variables/page.mdx": "2025-05-26T15:06:07.800Z",
9696
"app/learn/build/page.mdx": "2025-04-25T12:34:33.914Z",
9797
"app/learn/deployment/general/page.mdx": "2025-06-20T08:36:05.063Z",
98-
"app/learn/fundamentals/workflows/multiple-step-usage/page.mdx": "2024-11-25T16:19:32.169Z",
98+
"app/learn/fundamentals/workflows/multiple-step-usage/page.mdx": "2025-08-01T14:59:59.501Z",
9999
"app/learn/installation/page.mdx": "2025-07-23T14:28:50.404Z",
100100
"app/learn/fundamentals/data-models/check-constraints/page.mdx": "2025-07-25T13:50:21.065Z",
101101
"app/learn/fundamentals/module-links/link/page.mdx": "2025-04-07T08:03:14.513Z",

www/apps/book/public/llms-full.txt

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19385,7 +19385,7 @@ To find a full example of a long-running workflow, refer to the [restaurant-deli
1938519385
In the recipe, you use a long-running workflow that moves an order from placed to completed. The workflow waits for the restaurant to accept the order, the driver to pick up the order, and other external actions.
1938619386

1938719387

19388-
# Multiple Step Usage in Workflow
19388+
# Multiple Step Usage in Workflows
1938919389

1939019390
In this chapter, you'll learn how to use a step multiple times in a workflow.
1939119391

@@ -19395,7 +19395,7 @@ In some cases, you may need to use a step multiple times in the same workflow.
1939519395

1939619396
The most common example is using the `useQueryGraphStep` multiple times in a workflow to retrieve multiple unrelated data, such as customers and products.
1939719397

19398-
Each workflow step must have a unique ID, which is the ID passed as a first parameter when creating the step:
19398+
Steps must have a unique ID, which you pass as the first parameter of the `createStep` function.
1939919399

1940019400
```ts
1940119401
const useQueryGraphStep = createStep(
@@ -19404,7 +19404,7 @@ const useQueryGraphStep = createStep(
1940419404
)
1940519405
```
1940619406

19407-
This causes an error when you use the same step multiple times in a workflow, as it's registered in the workflow as two steps having the same ID:
19407+
So, when a step is used multiple times in a workflow, it's registered multiple times in the workflow with the same ID, which causes an error.
1940819408

1940919409
```ts
1941019410
const helloWorkflow = createWorkflow(
@@ -19434,7 +19434,7 @@ When you execute a step in a workflow, you can chain a `config` method to it to
1943419434

1943519435
Use the `config` method to change a step's ID for a single execution.
1943619436

19437-
So, this is the correct way to write the example above:
19437+
For example, this is the correct way to write the example above:
1943819438

1943919439
```ts highlights={highlights}
1944019440
const helloWorkflow = createWorkflow(
@@ -19454,7 +19454,7 @@ const helloWorkflow = createWorkflow(
1945419454
)
1945519455
```
1945619456

19457-
The `config` method accepts an object with a `name` property. Its value is a new ID of the step to use for this execution only.
19457+
The `config` method accepts an object with a `name` property. Its value is the new ID for the step to use for this execution only.
1945819458

1945919459
The first `useQueryGraphStep` usage has the ID `use-query-graph`, and the second `useQueryGraphStep` usage has the ID `fetch-customers`.
1946019460

@@ -23262,22 +23262,51 @@ npm install
2326223262

2326323263
# API Key Concepts
2326423264

23265-
In this document, you’ll learn about the different types of API keys, their expiration and verification.
23265+
In this guide, you’ll learn about the different types of API keys, their expiration and verification.
2326623266

2326723267
## API Key Types
2326823268

2326923269
There are two types of API keys:
2327023270

2327123271
- `publishable`: A public key used in client applications, such as a storefront.
23272+
- This API key is useful for operations that do not require authentication, such as fetching product data or categories.
2327223273
- `secret`: A secret key used for authentication and verification purposes, such as an admin user’s authentication token or a password reset token.
23274+
- This API key is useful for operations that require authentication, such as creating orders or managing products as an admin user.
2327323275

2327423276
The API key’s type is stored in the `type` property of the [ApiKey data model](https://docs.medusajs.com/references/api-key/models/ApiKey/index.html.md).
2327523277

23278+
### Default Scopes and Permissions
23279+
23280+
In your Medusa application, a `publishable` API key is only useful to send requests to the [Store API routes](https://docs.medusajs.com/api/store). Learn more about it in the [Publishable API Keys](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/sales-channel/publishable-api-keys/index.html.md) guide.
23281+
23282+
In addition, a `secret` API key allows you to access the [Admin API routes](https://docs.medusajs.com/api/admin) and perform actions as the admin user that the key was created for. The `created_by` property of the [ApiKey data model](https://docs.medusajs.com/references/api-key/models/ApiKey/index.html.md) indicates the ID of the associated admin user.
23283+
23284+
***
23285+
23286+
## API Key Creation
23287+
23288+
When using the [Medusa Admin](https://docs.medusajs.com/user-guide/settings/developer/index.html.md) or [API routes](https://docs.medusajs.com/api/admin#api-keys), only admin users can create API keys.
23289+
23290+
You can also create API keys in your customizations using the [createApiKeysWorkflow](https://docs.medusajs.com/references/medusa-workflows/createApiKeysWorkflow/index.html.md).
23291+
23292+
***
23293+
23294+
## API Key Tokens
23295+
23296+
The API key data model has a `token` property that contains the actual key used for authentication.
23297+
23298+
This token is created using the `salt` property in the data model, which is a random string generated when the API key is created. The salt is a `64`-character hexadecimal string generated randomly using the `crypto` module in Node.js.
23299+
23300+
For display purposes, the API key data model also has a `redacted` property that contains the first six characters of the token, followed by `...`, then the last three characters of the token. You can use this property to show the API key in the UI without revealing the full token.
23301+
2327623302
***
2327723303

2327823304
## API Key Expiration
2327923305

23280-
An API key expires when it’s revoked using the [revoke method of the module’s main service](https://docs.medusajs.com/references/api-key/revoke/index.html.md).
23306+
An API key expires when it’s revoked using the [revokeApiKeysWorkflow](https://docs.medusajs.com/references/medusa-workflows/revokeApiKeysWorkflow/index.html.md). This method will set the following properties in the API key:
23307+
23308+
- `revoked_at`: The date and time when the API key was revoked.
23309+
- `revoked_by`: The ID of the user who revoked the API key.
2328123310

2328223311
The associated token is no longer usable or verifiable.
2328323312

@@ -79330,6 +79359,8 @@ To learn more about the commerce features that Medusa provides, check out Medusa
7933079359

7933179360
# Action Menu - Admin Components
7933279361

79362+
In this guide, you'll learn how to add an action menu to your Medusa Admin customizations.
79363+
7933379364
The Medusa Admin often provides additional actions in a dropdown shown when users click a three-dot icon.
7933479365

7933579366
![Example of an action menu in the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728291319/Medusa%20Resources/action-menu_jnus6k.png)
@@ -79555,6 +79586,8 @@ export default ProductWidget
7955579586

7955679587
# Container - Admin Components
7955779588

79589+
In this guide, you'll learn how to create a container component that matches the Medusa Admin's design conventions.
79590+
7955879591
The Medusa Admin wraps each section of a page in a container.
7955979592

7956079593
![Example of a container in the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728287102/Medusa%20Resources/container_soenir.png)
@@ -80101,6 +80134,8 @@ export default CustomPage
8010180134

8010280135
# Forms - Admin Components
8010380136

80137+
In this guide, you'll learn how to create forms that match the Medusa Admin's design conventions.
80138+
8010480139
The Medusa Admin has two types of forms:
8010580140

8010680141
1. Create forms, created using the [FocusModal UI component](https://docs.medusajs.com/ui/components/focus-modal/index.html.md).
@@ -80152,7 +80187,7 @@ export const CreateForm = () => {
8015280187
})
8015380188

8015480189
const handleSubmit = form.handleSubmit(({ name }) => {
80155-
// TODO submit to backend
80190+
// TODO: submit to backend
8015680191
console.log(name)
8015780192
})
8015880193

@@ -80218,7 +80253,7 @@ export const CreateForm = () => {
8021880253

8021980254
Unlike other components in this documentation, this form component isn't reusable. You have to create one for every resource that has a create form in the admin.
8022080255

80221-
Start by creating the file `src/admin/components/create-form.tsx` that you'll create the form in.
80256+
Start by creating the file `src/admin/components/create-form.tsx` in which you'll create the form.
8022280257

8022380258
### Create Validation Schema
8022480259

@@ -80254,7 +80289,7 @@ export const CreateForm = () => {
8025480289
})
8025580290

8025680291
const handleSubmit = form.handleSubmit(({ name }) => {
80257-
// TODO submit to backend
80292+
// TODO: submit to backend
8025880293
console.log(name)
8025980294
})
8026080295

@@ -80435,7 +80470,7 @@ export const EditForm = () => {
8043580470
})
8043680471

8043780472
const handleSubmit = form.handleSubmit(({ name }) => {
80438-
// TODO submit to backend
80473+
// TODO: submit to backend
8043980474
console.log(name)
8044080475
})
8044180476

@@ -80495,7 +80530,7 @@ export const EditForm = () => {
8049580530

8049680531
Unlike other components in this documentation, this form component isn't reusable. You have to create one for every resource that has an edit form in the admin.
8049780532

80498-
Start by creating the file `src/admin/components/edit-form.tsx` that you'll create the form in.
80533+
Start by creating the file `src/admin/components/edit-form.tsx` in which you'll create the form.
8049980534

8050080535
### Create Validation Schema
8050180536

@@ -80531,7 +80566,7 @@ export const EditForm = () => {
8053180566
})
8053280567

8053380568
const handleSubmit = form.handleSubmit(({ name }) => {
80534-
// TODO submit to backend
80569+
// TODO: submit to backend
8053580570
console.log(name)
8053680571
})
8053780572

@@ -80674,6 +80709,8 @@ It will add at the top of a product's details page a new section, and in its hea
8067480709

8067580710
# Header - Admin Components
8067680711

80712+
In this guide, you'll learn how to create a header component that matches the Medusa Admin's design conventions.
80713+
8067780714
Each section in the Medusa Admin has a header with a title, and optionally a subtitle with buttons to perform an action.
8067880715

8067980716
![Example of a header in a section](https://res.cloudinary.com/dza7lstvk/image/upload/v1728288562/Medusa%20Resources/header_dtz4gl.png)
@@ -80820,6 +80857,8 @@ This widget also uses a [Container](https://docs.medusajs.com/Users/shahednasser
8082080857

8082180858
# JSON View - Admin Components
8082280859

80860+
In this guide, you'll learn how to create a JSON view section that matches the Medusa Admin's design conventions.
80861+
8082380862
Detail pages in the Medusa Admin show a JSON section to view the current page's details in JSON format.
8082480863

8082580864
![Example of a JSON section in the admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728295129/Medusa%20Resources/json_dtbsgm.png)
@@ -81048,6 +81087,8 @@ This shows the JSON section at the top of the product page, passing it the objec
8104881087

8104981088
# Section Row - Admin Components
8105081089

81090+
In this guide, you'll learn how to create a section row component that matches the Medusa Admin's design conventions.
81091+
8105181092
The Medusa Admin often shows information in rows of label-values, such as when showing a product's details.
8105281093

8105381094
![Example of a section row in the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728292781/Medusa%20Resources/section-row_kknbnw.png)
@@ -81430,6 +81471,8 @@ To test it out, log into the Medusa Admin and open `http://localhost:9000/app/cu
8143081471

8143181472
# Single Column Layout - Admin Components
8143281473

81474+
In this guide, you'll learn how to create a layout component that matches the Medusa Admin's design conventions for pages with a single column of content.
81475+
8143381476
The Medusa Admin has pages with a single column of content.
8143481477

8143581478
This doesn't include the sidebar, only the main content.
@@ -81490,6 +81533,8 @@ This UI route also uses a [Container](https://docs.medusajs.com/Users/shahednass
8149081533

8149181534
# Two Column Layout - Admin Components
8149281535

81536+
In this guide, you'll learn how to create a layout component that matches the Medusa Admin's design conventions for pages with two columns of content.
81537+
8149381538
The Medusa Admin has pages with two columns of content.
8149481539

8149581540
This doesn't include the sidebar, only the main content.

www/apps/resources/app/admin-components/components/action-menu/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const metadata = {
1010

1111
# {metadata.title}
1212

13+
In this guide, you'll learn how to add an action menu to your Medusa Admin customizations.
14+
1315
The Medusa Admin often provides additional actions in a dropdown shown when users click a three-dot icon.
1416

1517
![Example of an action menu in the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728291319/Medusa%20Resources/action-menu_jnus6k.png)

www/apps/resources/app/admin-components/components/container/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const metadata = {
88

99
# {metadata.title}
1010

11+
In this guide, you'll learn how to create a container component that matches the Medusa Admin's design conventions.
12+
1113
The Medusa Admin wraps each section of a page in a container.
1214

1315
![Example of a container in the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728287102/Medusa%20Resources/container_soenir.png)

www/apps/resources/app/admin-components/components/forms/page.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const metadata = {
88

99
# {metadata.title}
1010

11+
In this guide, you'll learn how to create forms that match the Medusa Admin's design conventions.
12+
1113
The Medusa Admin has two types of forms:
1214

1315
1. Create forms, created using the [FocusModal UI component](!ui!/components/focus-modal).
@@ -59,7 +61,7 @@ export const CreateForm = () => {
5961
})
6062

6163
const handleSubmit = form.handleSubmit(({ name }) => {
62-
// TODO submit to backend
64+
// TODO: submit to backend
6365
console.log(name)
6466
})
6567

@@ -127,7 +129,7 @@ export const CreateForm = () => {
127129

128130
Unlike other components in this documentation, this form component isn't reusable. You have to create one for every resource that has a create form in the admin.
129131

130-
Start by creating the file `src/admin/components/create-form.tsx` that you'll create the form in.
132+
Start by creating the file `src/admin/components/create-form.tsx` in which you'll create the form.
131133

132134
### Create Validation Schema
133135

@@ -163,7 +165,7 @@ export const CreateForm = () => {
163165
})
164166

165167
const handleSubmit = form.handleSubmit(({ name }) => {
166-
// TODO submit to backend
168+
// TODO: submit to backend
167169
console.log(name)
168170
})
169171

@@ -344,7 +346,7 @@ export const EditForm = () => {
344346
})
345347

346348
const handleSubmit = form.handleSubmit(({ name }) => {
347-
// TODO submit to backend
349+
// TODO: submit to backend
348350
console.log(name)
349351
})
350352

@@ -406,7 +408,7 @@ export const EditForm = () => {
406408

407409
Unlike other components in this documentation, this form component isn't reusable. You have to create one for every resource that has an edit form in the admin.
408410

409-
Start by creating the file `src/admin/components/edit-form.tsx` that you'll create the form in.
411+
Start by creating the file `src/admin/components/edit-form.tsx` in which you'll create the form.
410412

411413
### Create Validation Schema
412414

@@ -442,7 +444,7 @@ export const EditForm = () => {
442444
})
443445

444446
const handleSubmit = form.handleSubmit(({ name }) => {
445-
// TODO submit to backend
447+
// TODO: submit to backend
446448
console.log(name)
447449
})
448450

www/apps/resources/app/admin-components/components/header/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const metadata = {
1010

1111
# {metadata.title}
1212

13+
In this guide, you'll learn how to create a header component that matches the Medusa Admin's design conventions.
14+
1315
Each section in the Medusa Admin has a header with a title, and optionally a subtitle with buttons to perform an action.
1416

1517
![Example of a header in a section](https://res.cloudinary.com/dza7lstvk/image/upload/v1728288562/Medusa%20Resources/header_dtz4gl.png)

www/apps/resources/app/admin-components/components/json-view-section/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const metadata = {
1010

1111
# {metadata.title}
1212

13+
In this guide, you'll learn how to create a JSON view section that matches the Medusa Admin's design conventions.
14+
1315
Detail pages in the Medusa Admin show a JSON section to view the current page's details in JSON format.
1416

1517
![Example of a JSON section in the admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728295129/Medusa%20Resources/json_dtbsgm.png)

www/apps/resources/app/admin-components/components/section-row/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const metadata = {
1010

1111
# {metadata.title}
1212

13+
In this guide, you'll learn how to create a section row component that matches the Medusa Admin's design conventions.
14+
1315
The Medusa Admin often shows information in rows of label-values, such as when showing a product's details.
1416

1517
![Example of a section row in the Medusa Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1728292781/Medusa%20Resources/section-row_kknbnw.png)

www/apps/resources/app/admin-components/layouts/single-column/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const metadata = {
88

99
# {metadata.title}
1010

11+
In this guide, you'll learn how to create a layout component that matches the Medusa Admin's design conventions for pages with a single column of content.
12+
1113
The Medusa Admin has pages with a single column of content.
1214

1315
<Note>

0 commit comments

Comments
 (0)