Hi!
While setting up my CI/CD pipelines for my Shopify Embedded App, I was wondering if it is possible to interpolate environment variables somehow in the shopify.app.toml
file.
I find creating a copy/environment a bit tedious, and also i will need the flexibility for changing for example the application url of the application, while keeping the static stuff (webhooks,access scopes) in tact.
RIght now my only thought is to use the sed
utility to somehow replace those lines that i want to manage dinamically.
Also it gets a bit cumbersome as well to share a single configuration in a team and collaborate, somebody will always overwrite these values during development in the toml file.
What are your thoughts on this? Is there anything related to this feature on the roadmap? How did you handle similar a use case? Im all ears!
Thanks for your answers in advance!
Hey @Bendeguz_Gulyas,
I’m not sure if you can use environmental variables in the TOML files but you can have multiple TOML files in the same project. For example, in one of our apps we have:
shopify.app.dev.toml
shopify.app.devembedded.toml
shopify.app.prod.toml
shopify.app.staging.toml
You can create a new config with the CLI by doing shopify app config link
and it will prompt you for a new name for the config file.
Then you can switch between the configs with shopify app config use shopify.app.staging.toml
.
This doesn’t directly answer the question about using environmental variables but it does let you keep the configurations for different versions of the Shopify app in the same project. I hope this helps,
Daniel
Hi! I’m afraid it’s not possible to use variables in the TOML, but it’s something we are already exploring.
In the meanwhile, you can use multiple TOML files as @Daniel_Ablestar suggests.
Thanks for the suggestion!