How to handle to theme extensions (staging and production)

Hey,

since we are now forced to use the cli theme extensions, how can I switch the theme extensions of my apps within a project?

I have the following scenario:

I have a staging app and a production app in my partner dashboard.

Those app have there own theme extensions. In the past i could simply use the staging app toml and and run shopify app deploy and the staging app theme extensions was updated.

I have now migrated to the newest cli and run shopify app import-extensions for the staging app. But now I can not download/create the uid for the production app. Which is currently a blocker to release new features to my customers.

What do I need to do, to be able to have on code project and run 2 different theme extensions environment with 2 different uids?

Thanks for the help.

Kevin

For me,

Both server has different toml file. And when I ran npm run deploy it generated UUIDs respectively.

Hi Kevin,

Thanks for reaching out about managing theme extensions with the newest CLI version!

You only need the one uid for each extension since it can be used across all your app project environments.

The main difference in managing both apps would be the shopify.app.toml files. To do this, you will want to utilize config in your CLI commands. I’ll share more info on how you can do that below :slight_smile:

Initial setup

  1. Navigate to your app project in the terminal

  2. Link your first app (e.g. staging) (docs)

shopify app config link [flags]

  • Choose to connect to your existing staging app
  • This creates a shopify.app.toml file
  1. Link your second app (e.g. production) (docs)

shopify app config link [flags]

  • Choose to connect to your existing production app
  • Enter a configuration file name (e.g. production)
  • This creates a shopify.app.production.toml file
  1. Set your default config (docs)
  • shopify app config use [config] [flags]

app config link docs for reference.

  1. Copy the uid value from your staging app to your production app by merging into the appropriate code branch for the production app (docs)
  • shopify app deploy --config <name>

After initial setup

  • shopify app deploy --config <value>
  • shopify app dev --config <value>
  • shopify app release --version <version> --config <value>

You can find more information on this in our migration guide. Hope that helps!

Hey,

yes that helps a lot. Thank you very much.

Best,
Kevin

1 Like