docs: document JS SDK installation (#9611)

- Add a page introducing JS SDK + how to install and use it (generally)
- Adjust admin tips on how to send requests
- Adjust storefront tips to mention JS SDK
- Add in the API reference intro how to install JS SDK
- Other related additions / changes

Closes DX-957
This commit is contained in:
Shahed Nasser
2024-10-18 12:47:40 +00:00
committed by GitHub
parent 5b91d71318
commit 85865c18ff
11 changed files with 666 additions and 184 deletions
@@ -8,11 +8,15 @@ Check out the [Medusa v2 Documentation](https://docs.medusajs.com/v2).
<Space bottom={8} />
<Note type="soon">
<H3 className="!mt-0">Medusa JS SDK</H3>
JavaScript client libraries are coming soon for Medusa v2.
To use Medusa's JS SDK library, install the following packages in your project (not required for admin customizations):
</Note>
```bash
npm install @medusajs/js-sdk@rc @medusajs/types@rc
```
Learn more about the JS SDK in [this documentation](https://docs.medusajs.com/v2/resources/js-sdk).
### Download Full Reference
@@ -1,3 +1,5 @@
import { CodeTabs, CodeTab } from "docs-ui"
export const metadata = {
title: `${pageNumber} Admin Development Tips`,
}
@@ -8,42 +10,64 @@ In this chapter, you'll find some tips for your admin development.
## Send Requests to API Routes
To send a request to an API route in the Medusa Application, use the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
To send a request to an API route in the Medusa Application, use Medusa's [JS SDK](!resources!/js-sdk) with [Tanstack Query](https://tanstack.com/query/latest). Both of these tools are installed in your project by default.
First, create the file `src/admin/lib/config.ts` to setup the SDK for use in your customizations:
```ts
import Medusa from "@medusajs/js-sdk"
export const sdk = new Medusa({
baseUrl: "http://localhost:9000",
debug: process.env.NODE_ENV === "development",
auth: {
type: "session",
},
})
```
<Note>
Learn more about the JS SDK's configurations [this documentation](!resources!/js-sdk#js-sdk-configurations).
</Note>
Then, use the configured SDK with the `useQuery` Tanstack Query hook to send `GET` requests, and `useMutation` hook to send `POST` or `DELETE` requests.
For example:
export const fetchHighlights = [
["14", "fetch", "Send a request to the `/admin/products` API route."]
<CodeTabs group="query-type">
<CodeTab label="Query" value="query">
export const queryHighlights = [
["8", "useQuery", "Use Tanstack Query's `useQuery` to send a `GET` request."],
["9", "sdk.admin.product.list", "Use the SDK to send the request."],
["10", "queryKey", "Specify the key used to cache data."]
]
```tsx title="src/admin/widgets/product-widget.tsx" highlights={fetchHighlights}
```tsx title="src/admin/widgets/product-widget.ts" highlights={queryHighlights}
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Container } from "@medusajs/ui"
import { useEffect, useState } from "react"
import { Button, Container } from "@medusajs/ui"
import { useQuery } from "@tanstack/react-query"
import { sdk } from "../lib/config"
import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = () => {
const [productsCount, setProductsCount] = useState(0)
const [loading, setLoading] = useState(true)
useEffect(() => {
if (!loading) {
return
}
fetch(`/admin/products`, {
credentials: "include",
})
.then((res) => res.json())
.then(({ count }) => {
setProductsCount(count)
setLoading(false)
})
}, [loading])
const { data, isLoading } = useQuery({
queryFn: () => sdk.admin.product.list(),
queryKey: ["products"]
})
return (
<Container className="divide-y p-0">
{loading && <span>Loading...</span>}
{!loading && <span>You have {productsCount} Product(s).</span>}
{isLoading && <span>Loading...</span>}
{data?.products && (
<ul>
{data.products.map((product) => (
<li key={product.id}>{product.title}</li>
))}
</ul>
)}
</Container>
)
}
@@ -55,7 +79,52 @@ export const config = defineWidgetConfig({
export default ProductWidget
```
In this example, you send a request to the [List Products API route](!api!/admin#products_getproducts) and show the count of products in a widget.
</CodeTab>
<CodeTab label="Mutation" value="mutation">
export const mutationHighlights = [
["10", "useMutation", "Use Tanstack Query's `useMutation` to send `POST` or `DELETE` requests."],
["12", "sdk.admin.product.update", "Use the configured SDK to send the request."],
]
```tsx title="src/admin/widgets/product-widget.ts" highlights={mutationHighlights}
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Button, Container } from "@medusajs/ui"
import { useMutation } from "@tanstack/react-query"
import { sdk } from "../lib/config"
import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = ({
data: productData
}: DetailWidgetProps<HttpTypes.AdminProduct>) => {
const { mutateAsync } = useMutation({
mutationFn: (payload: HttpTypes.AdminUpdateProduct) =>
sdk.admin.product.update(productData.id, payload),
onSuccess: () => alert("updated product")
})
const handleUpdate = () => {
mutateAsync({
title: "New Product Title"
})
}
return (
<Container className="divide-y p-0">
<Button onClick={handleUpdate}>Update Title</Button>
</Container>
)
}
export const config = defineWidgetConfig({
zone: "product.details.before",
})
export default ProductWidget
```
</CodeTab>
</CodeTabs>
---
@@ -10,7 +10,7 @@ You're free to choose how to build your storefront. You can start with our Next.
<Note title="Tip">
To learn how to build a storefront from scratch, check out the [Storefront Development guides](!resources!/storefront-development) in the Development Resources documentation.
To learn how to build a storefront from scratch, check out the [Storefront Development guides](!resources!/storefront-development).
</Note>
+395
View File
@@ -0,0 +1,395 @@
import { CodeTabs, CodeTab, Table } from "docs-ui"
export const metadata = {
title: `Medusa JS SDK`,
}
# {metadata.title}
In this documentation, you'll learn how to install and use Medusa's JS SDK.
## What is Medusa JS SDK?
Medusa's JS SDK is a library to easily send requests to your Medusa application. You can use it in your admin customizations or custom storefronts.
---
## How to Install Medusa JS SDK?
The Medusa JS SDK is available in your Medusa application by default. So, you don't need to install it before using it in your admin customizations.
To install the Medusa JS SDK in other projects, such as a custom storefront, run the following command:
```bash npm2yarn
npm install @medusajs/js-sdk@rc @medusajs/types@rc
```
You install two libraries:
- `@medusajs/js-sdk`: the Medusa JS SDK.
- `@medusajs/types`: Medusa's types library, which is useful if you're using TypeScript in your development.
---
## Setup JS SDK
In your project, create the following `config.ts` file:
<Note>
For admin customizations, create this file at `src/admin/lib/config.ts`.
</Note>
<CodeTabs group="sdk-project">
<CodeTab label="Admin" value="admin">
```ts title="src/admin/lib/config.ts"
import Medusa from "@medusajs/js-sdk"
export const sdk = new Medusa({
baseUrl: "http://localhost:9000",
debug: process.env.NODE_ENV === "development",
auth: {
type: "session",
},
})
```
</CodeTab>
<CodeTab label="Storefront" value="storefront">
```ts title="config.ts"
import Medusa from "@medusajs/js-sdk"
let MEDUSA_BACKEND_URL = "http://localhost:9000"
if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) {
MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL
}
export const sdk = new Medusa({
baseUrl: MEDUSA_BACKEND_URL,
debug: process.env.NODE_ENV === "development",
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
})
```
</CodeTab>
</CodeTabs>
### JS SDK Configurations
The `Medusa` initializer accepts as a parameter an object with the following properties:
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Property</Table.HeaderCell>
<Table.HeaderCell className="w-2/5">Description</Table.HeaderCell>
<Table.HeaderCell>Default</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`baseUrl`
</Table.Cell>
<Table.Cell>
A required string indicating the URL to the Medusa backend.
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`publishableKey`
</Table.Cell>
<Table.Cell>
A string indicating the publishable API key to use in the storefront. You can retrieve it from the Medusa Admin.
This is required for storefront applications. Otherwise, all requests will fail.
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`auth.type`
</Table.Cell>
<Table.Cell>
A string that specifies the user authentication method to use.
Possible types are:
- `session`: The user is authenticated with a cookie session.
- `jwt`: The user is authenticated with a JWT token that's passed in the Bearer authorization header.
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`auth.jwtTokenStorageKey`
</Table.Cell>
<Table.Cell>
A string that, when `auth.type` is `jwt`, specifies the key of the JWT token in the storage specified in the `auth.jwtTokenStorageMethod` configuration.
</Table.Cell>
<Table.Cell>
`medusa_auth_token`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`auth.jwtTokenStorageMethod`
</Table.Cell>
<Table.Cell>
A string that, when `auth.type` is `jwt`, specifies where the JWT token is stored. Possible values are:
- `local` for the Local Storage.
- `session` for the Session Storage.
- `memory` to store it within the SDK for the current application's runtime.
</Table.Cell>
<Table.Cell>
`local`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`globalHeaders`
</Table.Cell>
<Table.Cell>
An object of key-value pairs indicating headers to pass in all requests, where the key indicates the name of the header field.
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`apiKey`
</Table.Cell>
<Table.Cell>
A string indicating the admin user's API key. If specified, it's used to send authenticated requests.
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`debug`
</Table.Cell>
<Table.Cell>
A boolean indicating whether to show debug messages of requests sent in the console. This is useful during development.
</Table.Cell>
<Table.Cell>
`false`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`logger`
</Table.Cell>
<Table.Cell>
Replace the logger used by the JS SDK to log messages. The logger must be a class or object having the following methods:
- `error`: A function that accepts an error message to log.
- `warn`: A function that accepts a warning message to log.
- `info`: A function that accepts an info message to log.
- `debug`: A function that accepts a debug message to log.
</Table.Cell>
<Table.Cell>
JavaScript's [console](https://developer.mozilla.org/en-US/docs/Web/API/console) is used by default.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
---
## Medusa JS SDK Tips
### Use Tanstack (React) Query in Admin Customizations
In admin customizations, use [Tanstack Query](https://tanstack.com/query/latest) with the JS SDK to send requests to custom or existing API routes.
Tanstack Query is installed by default in your Medusa application.
Use the [configured SDK](#setup-js-sdk) with the [useQuery](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery#usequery) Tanstack Query hook to send `GET` requests, and [useMutation](https://tanstack.com/query/latest/docs/framework/react/reference/useMutation#usemutation) hook to send `POST` or `DELETE` requests.
For example:
<CodeTabs group="query-type">
<CodeTab label="Query" value="query">
export const queryHighlights = [
["8", "useQuery", "Use Tanstack Query's `useQuery` to send a `GET` request."],
["9", "sdk.admin.product.list", "Use the SDK to send the request."],
["10", "queryKey", "Specify the key used to cache data."]
]
```tsx title="src/admin/widgets/product-widget.ts"
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Button, Container } from "@medusajs/ui"
import { useQuery } from "@tanstack/react-query"
import { sdk } from "../lib/config"
import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = () => {
const { data, isLoading } = useQuery({
queryFn: () => sdk.admin.product.list(),
queryKey: ["products"]
})
return (
<Container className="divide-y p-0">
{isLoading && <span>Loading...</span>}
{data?.products && (
<ul>
{data.products.map((product) => (
<li key={product.id}>{product.title}</li>
))}
</ul>
)}
</Container>
)
}
export const config = defineWidgetConfig({
zone: "product.list.before",
})
export default ProductWidget
```
</CodeTab>
<CodeTab label="Mutation" value="mutation">
```tsx title="src/admin/widgets/product-widget.ts"
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Button, Container } from "@medusajs/ui"
import { useMutation } from "@tanstack/react-query"
import { sdk } from "../lib/config"
import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = ({
data: productData
}: DetailWidgetProps<HttpTypes.AdminProduct>) => {
const { mutateAsync } = useMutation({
mutationFn: (payload: HttpTypes.AdminUpdateProduct) =>
sdk.admin.product.update(productData.id, payload),
onSuccess: () => alert("updated product")
})
const handleUpdate = () => {
mutateAsync({
title: "New Product Title"
})
}
return (
<Container className="divide-y p-0">
<Button onClick={handleUpdate}>Update Title</Button>
</Container>
)
}
export const config = defineWidgetConfig({
zone: "product.details.before",
})
export default ProductWidget
```
</CodeTab>
</CodeTabs>
Refer to Tanstack Query's documentation to learn more about sending [Queries](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery#usequery) and [Mutations](https://tanstack.com/query/latest/docs/framework/react/reference/useMutation#usemutation).
### Cache in Next.js Projects
Every method of the SDK that sends requests accepts as a last parameter an object of key-value headers to pass in the request.
In Next.js storefronts or projects, pass the `next.tags` header in the last parameter for data caching.
For example:
```ts highlights={[["2", "next"], ["3", "tags", "An array of tags to cache the data under."]]}
sdk.store.product.list({}, {
next: {
tags: ["products"]
}
})
```
The `tags` property accepts an array of tags that the data is cached under.
Then, to purge the cache later, use Next.js's `revalidateTag` utility:
```ts
import { revalidateTag } from "next/cache";
// ...
revalidateTag("products")
```
Learn more in the [Next.js documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).
+8 -2
View File
@@ -20,7 +20,8 @@ import {
DocumentTextSolid,
Stripe,
PhotoSolid,
BuildingsSolid
BuildingsSolid,
Javascript
} from "@medusajs/icons"
# Medusa Development Resources
@@ -127,7 +128,12 @@ Follow the [Medusa v2 Docs](!docs!) to become an advanced Medusa developer.
## SDKs and Tools
<CardList itemsPerRow={2} items={[
<CardList itemsPerRow={3} items={[
{
icon: Javascript,
title: "JS SDK",
href: "/js-sdk",
},
{
icon: CommandLineSolid,
title: "Medusa CLI",
@@ -8,17 +8,10 @@ In this document, youll find tips useful when building a storefront.
## Connect to the Medusa Application
<Note type="soon">
Support for Medusa v2 in Medusa React and the JS Client is coming soon.
</Note>
To send requests from the storefront to the Medusa applications Store API Routes, you have three options:
- **For JavaScript frameworks**: use Medusas [JS SDK](../../js-sdk/page.mdx) in any JavaScript framework. This NPM package facilitates interacting with the backends REST APIs.
- **For other frontend technologies**: interact directly with the Medusa application by sending requests to its [Store REST APIs](https://docs.medusajs.com/api/store).
- **For React-based storefronts**: use Medusa React. It provides you with the necessary hooks to retrieve or manipulate data from your Medusa application.
- **For JavaScript frameworks**: use Medusas JavaScript Client in any JavaScript framework. This NPM package facilitates interacting with the backends REST APIs.
---
@@ -26,7 +19,7 @@ To send requests from the storefront to the Medusa applications Store API Rou
The `@medusajs/types` package provide API routes' request and response types.
If you're not using the JS Client or Medusa React, install `@medusajs/types` to use the correct request and response types:
If you're not using the JS SDK, install `@medusajs/types` to use the correct request and response types:
```bash npm2yarn
npm install @medusajs/types@rc
+5 -9
View File
@@ -193,7 +193,7 @@ export const generatedEditDates = {
"app/storefront-development/regions/list/page.mdx": "2024-09-11T10:07:34.742Z",
"app/storefront-development/regions/store-retrieve-region/page.mdx": "2024-09-11T10:07:42.887Z",
"app/storefront-development/regions/page.mdx": "2024-06-09T15:19:09+02:00",
"app/storefront-development/tips/page.mdx": "2024-09-11T09:25:17.014Z",
"app/storefront-development/tips/page.mdx": "2024-10-16T12:44:31.781Z",
"app/storefront-development/page.mdx": "2024-06-09T15:19:09+02:00",
"app/troubleshooting/cors-errors/page.mdx": "2024-05-03T17:36:38+03:00",
"app/troubleshooting/create-medusa-app-errors/page.mdx": "2024-07-11T10:29:13+03:00",
@@ -206,7 +206,7 @@ export const generatedEditDates = {
"app/troubleshooting/page.mdx": "2024-07-18T08:57:11+02:00",
"app/upgrade-guides/page.mdx": "2024-07-18T08:57:11+02:00",
"app/usage/page.mdx": "2024-05-13T18:55:11+03:00",
"app/page.mdx": "2024-08-13T08:51:20+02:00",
"app/page.mdx": "2024-10-16T11:40:59.669Z",
"app/commerce-modules/auth/_events/_events-table/page.mdx": "2024-07-03T19:27:13+03:00",
"app/commerce-modules/auth/auth-flows/page.mdx": "2024-09-05T08:50:11.671Z",
"app/commerce-modules/auth/_events/page.mdx": "2024-07-03T19:27:13+03:00",
@@ -2222,9 +2222,7 @@ export const generatedEditDates = {
"app/commerce-modules/api-key/links-to-other-modules/page.mdx": "2024-10-08T08:05:36.596Z",
"app/commerce-modules/cart/extend/page.mdx": "2024-10-08T11:22:22.523Z",
"app/commerce-modules/cart/links-to-other-modules/page.mdx": "2024-10-08T08:22:35.190Z",
"app/commerce-modules/auth/reset-password/page.mdx": "2024-09-25T09:36:26.592Z",
"app/storefront-development/customers/reset-password/page.mdx": "2024-09-25T10:21:46.647Z",
"app/commerce-modules/customer/extend/page.mdx": "2024-10-09T14:43:37.836Z",
"app/commerce-modules/customer/extend/page.mdx": "2024-10-08T14:18:55.407Z",
"app/commerce-modules/fulfillment/links-to-other-modules/page.mdx": "2024-10-08T14:58:24.935Z",
"app/commerce-modules/inventory/links-to-other-modules/page.mdx": "2024-10-08T15:18:30.109Z",
"app/commerce-modules/pricing/links-to-other-modules/page.mdx": "2024-10-09T13:51:49.986Z",
@@ -2236,9 +2234,6 @@ export const generatedEditDates = {
"app/commerce-modules/order/links-to-other-modules/page.mdx": "2024-10-09T11:23:05.488Z",
"app/commerce-modules/order/order-change/page.mdx": "2024-10-09T09:59:40.745Z",
"app/commerce-modules/payment/links-to-other-modules/page.mdx": "2024-10-09T11:23:02.023Z",
"app/commerce-modules/customer/extend/page.mdx": "2024-10-08T14:18:55.407Z",
"app/commerce-modules/fulfillment/links-to-other-modules/page.mdx": "2024-10-08T14:58:24.935Z",
"app/commerce-modules/inventory/links-to-other-modules/page.mdx": "2024-10-08T15:18:30.109Z",
"references/core_flows/Cart/Workflows_Cart/variables/core_flows.Cart.Workflows_Cart.THREE_DAYS/page.mdx": "2024-10-14T09:11:19.432Z",
"references/core_flows/Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx": "2024-10-14T09:11:20.044Z",
"references/core_flows/Payment/Workflows_Payment/functions/core_flows.Payment.Workflows_Payment.onPaymentProcessedWorkflow/page.mdx": "2024-10-14T09:11:37.781Z",
@@ -2296,5 +2291,6 @@ export const generatedEditDates = {
"app/commerce-modules/stock-location/links-to-other-modules/page.mdx": "2024-10-15T14:33:11.483Z",
"app/commerce-modules/store/links-to-other-modules/page.mdx": "2024-06-26T07:19:49.931Z",
"app/examples/page.mdx": "2024-10-15T12:19:18.820Z",
"app/medusa-cli/commands/build/page.mdx": "2024-10-16T08:16:27.618Z"
"app/medusa-cli/commands/build/page.mdx": "2024-10-16T08:16:27.618Z",
"app/js-sdk/page.mdx": "2024-10-16T12:12:34.512Z"
}
@@ -595,6 +595,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/app/integrations/page.mdx",
"pathname": "/integrations"
},
{
"filePath": "/www/apps/resources/app/js-sdk/page.mdx",
"pathname": "/js-sdk"
},
{
"filePath": "/www/apps/resources/app/medusa-cli/commands/build/page.mdx",
"pathname": "/medusa-cli/commands/build"
+138 -133
View File
@@ -7967,136 +7967,6 @@ export const generatedSidebar = [
"title": "Integrations",
"children": []
},
{
"type": "separator"
},
{
"loaded": true,
"isPathHref": true,
"type": "category",
"title": "SDKs and Tools",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/create-medusa-app",
"title": "create-medusa-app",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli",
"title": "Medusa CLI",
"isChildSidebar": true,
"childSidebarTitle": "Medusa CLI Reference",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli",
"title": "Overview",
"children": []
},
{
"type": "separator"
},
{
"loaded": true,
"isPathHref": true,
"type": "category",
"title": "Commands",
"autogenerate_path": "medusa-cli/commands",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/new",
"title": "new",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/develop",
"title": "develop",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/start",
"title": "start",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/user",
"title": "user",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/build",
"title": "build",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/db",
"title": "db",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/exec",
"title": "exec",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/start-cluster",
"title": "start-cluster",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/telemtry",
"title": "telemetry",
"children": []
}
]
}
]
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/nextjs-starter",
"title": "Next.js Starter",
"children": []
}
]
},
{
"loaded": true,
"isPathHref": true,
@@ -8534,6 +8404,144 @@ export const generatedSidebar = [
{
"type": "separator"
},
{
"loaded": true,
"isPathHref": true,
"type": "category",
"title": "SDKs and Tools",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/create-medusa-app",
"title": "create-medusa-app",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli",
"title": "Medusa CLI",
"isChildSidebar": true,
"childSidebarTitle": "Medusa CLI Reference",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli",
"title": "Overview",
"children": []
},
{
"type": "separator"
},
{
"loaded": true,
"isPathHref": true,
"type": "category",
"title": "Commands",
"autogenerate_path": "medusa-cli/commands",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/new",
"title": "new",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/develop",
"title": "develop",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/start",
"title": "start",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/user",
"title": "user",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/build",
"title": "build",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/db",
"title": "db",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/exec",
"title": "exec",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/start-cluster",
"title": "start-cluster",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/medusa-cli/commands/telemtry",
"title": "telemetry",
"children": []
}
]
}
]
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/js-sdk",
"title": "JS SDK",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/nextjs-starter",
"title": "Next.js Starter",
"children": []
}
]
},
{
"type": "separator"
},
{
"loaded": true,
"isPathHref": true,
@@ -8766,9 +8774,6 @@ export const generatedSidebar = [
}
]
},
{
"type": "separator"
},
{
"loaded": true,
"isPathHref": true,
+5
View File
@@ -2045,6 +2045,11 @@ export const sidebar = sidebarAttachHrefCommonOptions([
},
],
},
{
type: "link",
path: "/js-sdk",
title: "JS SDK",
},
{
type: "link",
path: "/nextjs-starter",
+5
View File
@@ -76,6 +76,11 @@ export const navDropdownItems: NavigationItem[] = [
title: "Medusa CLI",
link: "/v2/resources/medusa-cli",
},
{
type: "link",
title: "JS SDK",
link: "/v2/resources/js-sdk",
},
{
type: "link",
title: "Next.js Starter",