-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Env variables support #4587
Comments
Hey @patryk-smc , there is already a way to do this for UI extensions:
The CLI will automatically replace You can also load variables automatically by defining a custom script in your package.json that does it. Does this work for you? |
Hi @isaacroldan |
I'm aware of the lack of documentation for this, sorry about that. But this is stable and shouldn't change in the short term. |
@isaacroldan Thanks! It works. So my only suggestion would be to have CLI log in the console that certain env variables are read (both in dev and during deployment). Thanks again for your help. |
Unfortunately that's not possible. They way it works is that we pass the contents of Since it has been solved, i'll close the issue :) |
What area(s) will this request affect?
Extension
What type of change do you want to see?
New feature
Overview
I thought it would be nice to have env variables support similar to Vite (https://vite.dev/guide/env-and-mode) - those can be set in .env file or in vite config. In Shopify CLI I imagine that they could be set on shopify.app.toml level and possibly in .env file. Then it should replace all
import.meta.env...
in extension files.Motivation
Need simpler way to store API endpoint variable depending on the environment (dev/staging/production)
The text was updated successfully, but these errors were encountered: