- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Next.js Starter
The Next.js Starter storefront provides rich commerce features and a sleek design. Developers and businesses can use it as-is or as a starting point to build a storefront for their Medusa application.
Installation#
- Clone the
v2
branch of the Next.js Starter:
- Change to the
my-medusa-storefront
directory, install the dependencies, and rename the template environment variable:
- While the Medusa application is running, start the Next.js storefront:
Your Next.js Starter Storefront is now running at localhost:8000
.
Troubleshooting#
Next.js storefront not working using option 1
CORS Error
Resolve "Cannot find module X" Errors
Payment Providers#
The Next.js Starter storefront is compatible with Medusa's Stripe and PayPal plugins.
Stripe Integration#
In your Next.js Starter project, set the following environment variables for the Stripe integration:
Where <YOUR_PUBLISHABLE_KEY>
is your Stripe publishable key. You can retrieve it from your Stripe dashboard by going to Developers → API Keys.
Then, restart the Next.js Starter storefront. You can now use Stripe during checkout.
Change Medusa Application URL#
By default, the Medusa application runs at http://localhost:9000
. This value is defined in your Next.js Starter storefront under the environment variable NEXT_PUBLIC_MEDUSA_BACKEND_URL
.
To change the URL of the Medusa application in the storefront, set the NEXT_PUBLIC_MEDUSA_BACKEND_URL
environment variable: