What @AlexKokobane said is correct. Once you begin the act of deploying, this is merely an express app, and depending on which cloud provider you are utilizing, instructions could drastically change.
However, I’ll tell you my specific solution.
When running Shopify app dev, there is a wrapper around your environment that provides a global
configuration for the following:
apiKey: 'APIKeyFromPartnersDashboard',
apiSecretKey: 'APISecretFromPartnersDashboard',
scopes: ['read_products'],
hostName: 'ngrok-tunnel-address',
So when you deploy you’ll need to provide that directly into the API parameters.
I am currently using Shopify cli 3.47.5 and I didn’t really make that many core changes. So if you are following my current version it should look the same.
With in my “/web/shopify.js” I have the following
const shopify = shopifyApp({
api: {
apiKey: process.env.SHOPIFY_API_KEY,
apiSecretKey: process.env.SHOPIFY_API_SECRET,
hostName: process.env.SHOPIFY_APP_URL.replace(/https?:\/\//, ""),
apiVersion: LATEST_API_VERSION,
restResources,
billing: undefined, // billingConfig,
},
auth: {
....
Since I am using Heroku. I followed Shopify’s instructions on how to deploy to heroku.
But I also had to add a “start” script in my package.json
It looks something like this.
...
"start": "cd web && npm run serve",
...
Hope this helps!