I’m currently working on a custom Shopify app and I want to set up a staging environment before going live. I’m a bit confused about the proper process for this.
My main questions are:
What’s the recommended way to create a staging setup for a Shopify app?
Should I create a separate development store for staging, or is there another best practice?
How can I properly test app features (API calls, webhooks, billing, etc.) in staging before pushing changes to production?
Is there any official documentation or guide that explains the full process step by step?
If anyone has experience with this or can guide me with the correct approach, I’d really appreciate your help.
I’m not sure if it’s the recommended way to do it, but while building DonkeyClip this is how I’ve solved the issue with a staging environment:
Create a separate app and install it to a separate development store (we’ve had issues where shopify billing got confused when we’ve had both staging and production apps installed to 1 store)
If you’re deploying to your staging site from your local machine, when you want to push changes to stating:
Update environment variables to point to your staging app instead of your development one
Use the command shopify config use to also change the config you’re using
If you’ve set up continuous deployment then make sure that you’ve used the variables that point to the staging app
We’ve ended up with 4 apps (one production, one staging and 2 for local development) and multiple dev stores for those apps.
Regarding testing, you use your app and see if everything works, or it might be worth investing in some automating tested for example using Playwright to set up some end to end tests. Depends on how much time you want to invest into it and how complicated your app is.
Finally, there are a lot of resources here and there regarding similar topics but I can’t remember of an official one, at least for me it’s been a lot of trial and error