A high-performance, server-rendered Next.js App Router ecommerce application template to use with Prodigy Commerce.
This template uses React Server Components, Server Actions, Suspense
, useOptimistic
, and more.
Note: You can also refer to Vercel's original Next.js Commerce here
You will need to use the environment variables defined in .env.example
to run Next.js Commerce. It's recommended you use Vercel Environment Variables for this, but a .env
file is all that is necessary.
Note: You should not commit your
.env
file or it will expose secrets that will allow others to control your Prodigy Commerce store.
- Install Vercel CLI:
npm i -g vercel
- Link local instance with Vercel and GitHub accounts (creates
.vercel
directory):vercel link
- Download your environment variables:
vercel env pull
pnpm install
pnpm dev
Your app should now be running on localhost:3000.
To deploy your Prodigy Commerce storefront on the Vercel platform you need to:
- Log into Prodigy Commerce account.
- Select your store in the stores list.
- Go to Settings in the navigation bar.
- If your store is not connected you'll see "Want to connect custom plugin?" link, click at that link. If your store is connected you'll need to disconnect it first.
- "Store Token" modal should open and you would be able to copy the token. Never share this token to anyone except highly trusted parties. This token grants almost full access to your store.
- Log into your Vercel account and go to the Dashboard.
- Click on "Add New..." button and select "Project" in the dropdown.
- In "Clone Template" section find this template by clicking "Browse All Templates" and searching. Then select it.
- If you could not find it there click at "Import Third-Party Git Repository" in the "Import Git Repository" section. then paste url of this repository into a field and click "Continue".
- Select your team and fill in name of your project.
- Click on "Environment Variables" to open a section.
- In there add
PRODIGY_STORE_TOKEN
variable with value from step 5. - Add
PRODIGY_API_DOMAIN
variable with valuehttps://api.prodigycommerce.com
. - Add
PRODIGY_CLIENT_DOMAIN
variable with valuehttps://{your-store-name}.prodigycommerce.com
. - Add
SITE_NAME
variable with name of your choice. - Add other environment variables you see fit. Refer to
.env.example
for the list. - Click "Deploy" button and you done. For any other question regarding Vercel platform refer to Vercel Docs.