MINIMUM SALEOR VERSION
MINIMUM SALEOR CLI VERSION 1.13
Vercel is a robust platform that enables hosting of static sites and frontend frameworks. It is built to integrate with a headless content, commerce, or database. It provides a smooth integration with Next.js so, in this guide we are going to set up the Saleor App template to be hosted on this platform.
saleor CLI with
npm i -g saleor.
Make sure you have established your organisation and environment in the Saleor Cloud.
Log in to Vercel and Github. In your Terminal, run:
saleor vercel login
saleor github login
If this is the first time you integrate with these platforms, you will be redirected to a dedicated page where you can finish the integration process.
saleor app create my-saleor-app.
After a few moments, you'll have your app named
my-saleor-app created locally, and your developer environment set up. Also, the CLI will automatically run the development server. You may stop the server with
cd my-saleor-appto go to the root of your app's project.
saleor app deploy.
The CLI will create a repository with the app on your Github account. Then, it will create a project in Vercel and deploy the app there. Lastly, it will take the
NEXT_PUBLIC_SALEOR_HOST_URL= variable from
.env file in your app and set it in the environmental variables in Vercel.
The URL to your Saleor App deployed to Vercel is displayed in CLI in the summary message.
If you desire to go through all the actions that
saleor app deploy command perform, you may follow the steps below. It will give you a deeper understanding of the process of deployment and will show you the extend to which Saleor CLI makes your life easier.
my-saleor-app. Copy the URL of the repository.
git add . git commit -m"First commit." git remote add origin <url-to-your-remote-repo> git branch -M main git push -u origin main
.envfile and copy the
NEXT_PUBLIC_SALEOR_HOST_URLand its value taken from your app project.
You can now use the URL of your deployed App in the process of i.e. Saleor App installation as described in Creating Apps with Saleor CLI.