Configure Shopify apps across development, staging, and production environments with separate stores, API credentials, and app instances. Use when setting up isolated dev/staging/prod environments for a Shopify app, managing multiple development stores, or configuring per-environment credentials. Trigger with phrases like "shopify environments", "shopify staging", "shopify dev vs prod", "shopify multi-store", "shopify environment setup".
Configure Shopify apps with isolated development, staging, and production environments. Each environment uses a separate Shopify app instance, development store, and credentials.
Create one app per environment in your Partner Dashboard:
| Environment | App Name | Store | Purpose |
|---|---|---|---|
| Development | My App (Dev) | dev-store.myshopify.com | Local development |
| Staging | My App (Staging) | staging-store.myshopify.com |
| Pre-prod testing |
| Production | My App | live-store.myshopify.com | Live traffic |
Each app gets its own API_KEY, API_SECRET, and ACCESS_TOKEN.
Create .env.* files for each environment and corresponding Shopify CLI TOML configs. Production secrets should never be stored on disk -- use a secret manager.
See Environment Config Files for the complete .env and .toml configuration templates.
TypeScript config module that loads environment-specific settings (debug mode, session storage type) with LATEST_API_VERSION from @shopify/shopify-api.
See Environment-Aware Config for the complete implementation.
Safety functions that prevent dangerous operations from running in the wrong environment (e.g., blocking test data seeding in production, requiring production for billing activation).
See Environment Guards for the complete implementation.
| Issue | Cause | Solution |
|---|---|---|
| Wrong store in dev | Using prod .env | Verify SHOPIFY_STORE in your .env file |
| OAuth fails on staging | Wrong redirect URL | Update redirect_urls in staging app config |
| Webhooks not received | URL mismatch | Each environment needs its own webhook URLs |
| Production guard triggered | Wrong NODE_ENV | Set NODE_ENV correctly in deployment platform |
# Create a development store from Partner Dashboard
# Partners > Stores > Add store > Development store
# Install your dev app on the dev store
shopify app dev --store=dev-store.myshopify.com
# Populate test data
shopify populate products --count=25
shopify populate orders --count=10
shopify populate customers --count=20