docs: update next.js storefront snippets (#10840)

This commit is contained in:
Shahed Nasser
2025-01-06 16:35:56 +02:00
committed by GitHub
parent 3253e19b36
commit 9490c265b2
4 changed files with 17 additions and 13 deletions
@@ -58,17 +58,17 @@ npm install
Then, expand the Environment Variables section and add the following variables:
```bash
NEXT_PUBLIC_MEDUSA_BACKEND_URL= # URL of Medusa application
MEDUSA_BACKEND_URL= # URL of Medusa application
NEXT_PUBLIC_DEFAULT_REGION=us # or a different region that you prefer
NEXT_PUBLIC_PUBLISHABLE_KEY= # publishable API key of the storefront's sales channel
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY= # publishable API key of the storefront's sales channel
REVALIDATE_SECRET=supersecret # TODO generate random string
```
Where:
1. `NEXT_PUBLIC_MEDUSA_BACKEND_URL` is the URL of your deployed Medusa application
1. `MEDUSA_BACKEND_URL` is the URL of your deployed Medusa application
2. `NEXT_PUBLIC_DEFAULT_REGION` is the country code of a region to be used by default, if the customer hasnt selected a region.
3. `NEXT_PUBLIC_PUBLISHABLE_KEY` is the publishable API key of the storefront. You can create one or find the default one in the Medusa Admin dashboard.
3. `NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY` is the publishable API key of the storefront. You can create one or find the default one in the Medusa Admin dashboard.
4. `REVALIDATE_SECRET` is a random string for [Next.js revalidation](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#on-demand-revalidation).
Make sure to add other relevant environment variables. For example, if youre using the Stripe Payment Module Provider in the Medusa application, add the `NEXT_PUBLIC_STRIPE_KEY` environment variable.