You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<imgsrc="https://vercel.com/button"alt="Deploy with Vercel"className="no-zoom-img"/>
18
-
</a>
19
-
20
-
:::note
21
-
22
-
After the deployment with this button, make sure to [configure CORS in your backend](#step-3-configure-cors-on-the-medusa-backend).
23
-
24
-
:::
25
-
26
13
## Prerequisites
27
14
28
15
### Medusa Components
@@ -31,6 +18,10 @@ It is assumed you already have installed the Next.js Starter Template locally. I
31
18
32
19
It’s also assumed you already have the Medusa backend deployed, which the Next.js Starter Template interacts with. If not, you can check out one of the [deployment documentation related to the Medusa backend](../server/index.mdx).
33
20
21
+
### Storefront Preparations
22
+
23
+
If you're not using the [Serverless Modules](../../starters/nextjs-medusa-starter.mdx#using-serverless-modules) in your storefront, either delete the `src/app/api` directory or exclude it in `.gitignore`. Otherwise, the deployment will fail.
24
+
34
25
### Required Accounts
35
26
36
27
-[Vercel Account](https://vercel.com)
@@ -102,7 +93,12 @@ This section explains how to deploy the storefront using the Vercel website:
102
93
3. Choose Project from the dropdown.
103
94
4. In the new page that opens, find the Git repository that holds your Next.js Starter Template and click on the Import button. If you haven’t connected your Vercel account to any Git provider, you must do that first.
104
95
5. In the Configure Project form:
105
-
1. Open the Environment Variables collapsible, and add an environment variable with the name `NEXT_PUBLIC_MEDUSA_BACKEND_URL` and the value being the URL to your deployed Medusa Backend.
96
+
1. Open the Environment Variables collapsible, and add the following environment variables:
97
+
-`NEXT_PUBLIC_MEDUSA_BACKEND_URL`: the URL to your deployed Medusa Backend.
98
+
-`NEXT_PUBLIC_BASE_URL`: The URL of your storefront. If you don't have a domain ready yet, you can add it later. However, you may face some errors in your storefront.
99
+
-`REVALIDATE_SECRET`: A secret used for revalidating data. Learn more in the [Next.js documentation](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation).
100
+
- If you're using Serverless modules, set the `POSTGRES_URL` environment variable to the connection URL of your PostgreSQL database, and set the `MEDUSA_FF_MEDUSA_V2=true` variable.
101
+
- You can set any other environment variables you're using at this step or later.
106
102
2. You can optionally edit the Project Name.
107
103
6. Once you’re done, click on the “Deploy” button.
108
104
@@ -122,9 +118,20 @@ In the directory holding your storefront, run the following command to deploy yo
Where `<YOUR_BACKEND_URL>` is the URL of your deployed Medusa backend.
125
+
Where:
126
+
127
+
-`<YOUR_BACKEND_URL>`: the URL of your deployed Medusa backend.
128
+
-`<YOUR_BASE_URL>`: The URL of your storefront. If you don't have a domain ready yet, you can add it later. However, you may face some errors in your storefront.
129
+
-`<YOUR_REVALIDATION_SECRET>`: A secret used for revalidating data. Learn more in the [Next.js documentation](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation).
130
+
131
+
In addition:
132
+
133
+
- If you're using Serverless modules, set the `POSTGRES_URL` environment variable to the connection URL of your PostgreSQL database, and set the `MEDUSA_FF_MEDUSA_V2=true` variable.
134
+
- You can set any other environment variables you're using at this step or later.
128
135
129
136
You’ll then be asked to log in if you haven’t already, and to choose the scope to deploy your project to. You can also decide to link the storefront to an existing project, or change the project’s name.
Copy file name to clipboardExpand all lines: www/apps/docs/content/starters/nextjs-medusa-starter.mdx
-27Lines changed: 0 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,35 +13,8 @@ import CorsErrorSection from '../troubleshooting/cors-issues.md'
13
13
14
14
This document guides you to install and set up the Next.js Starter Storefront.
15
15
16
-
<!--valedocs.We=NO-->
17
-
18
-
<QueryNote
19
-
query={{
20
-
key: 'ref',
21
-
value: 'gatsby-medusa-starter'
22
-
}}
23
-
admonition={{
24
-
type: 'note'
25
-
}}
26
-
>
27
-
We've deprecated the Gatsby starter storefront and instead recommend using the Next.js Starter Storefront or [building your own custom storefront](../storefront/roadmap.mdx).
0 commit comments