Shopify App Development Workflow (Dev & Prod)

Learn how to setup a Shopify app development workflow with local dev, testing & production

Shopify App Development Workflow (Dev & Prod)
Photo by hookle.app / Unsplash

I have been working on my first Shopify app and finally got it deployed but realized I had to make some changes (🤯 shocker, my code doesn't work first try). But now my app URLs are set to the production url and I don't want my local development (via Shopify CLI) to overwrite. How do I create different environments for my apps just like I would for my web apps (a local environment, a test environment, & a prod environment)?

I was seeing suggestions on the Shopify Forum to have different repositories for the different versions of the app and I refused to do that. There has to be an easier way & turns out there is!

Managing Shopify App Configs for Dev & Prod

After reading the docs: Managing App Configurations Files the answer finally clicked in my mind. Using the Shopify CLI you are able to generate different configuration files for your app. These different configuration files technically create different "Apps" in your Shopify Partner account, but the app code is the same, no need for multiple repositories!

Here's what we need to do:

  1. Run shopify app config link to create a new configuration file for your app. You will be asked if you want to create a new app. Make sure to select YES & give your new config a name to correspond to the environment you want to create.
  1. Run shopify app deploy to push this new "app" to the Shopify Partner Dashboard. Again this is the same app but just a different version (environment) of your app.
💡
If you are creating a prod configuration make sure to reset your dev configuration file to be the default: shopify app config use development. The Shopify CLI default behavior is to set the newly created configuration as the default.
  1. Create a new Shopify Development store for each version of your app and install your app into them.
  2. Now you are able to change your app urls for your prod and development versions of your app!
  3. When you are ready to deploy a new version of your app you can run shopify app deploy --config ${CONFIG} and specify your configuration file