Allowing MiniOxygen to read environment variables from the system environment #3729
z0n
started this conversation in
Ideas + Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! We're currently trying to improve our local dev security and want to get rid of clear text credentials in our
.envfiles (as you're never sure what AI does with them, even with sandboxing).We're using 1Password which allows you to resolve references to a value via CLI, e.g.
op read "op://..."->yoursecretapikey.In other (non-Hydrogen) projects, we just create a file like this:
And add
source op.env &&to our dev server command.This approach unfortunately doesn't work for Shopify as MiniOxygen does not read variables from the system environment.
I then noticed that it's possible to just leave out the
.envfile completely and Hydrogen will pull them from Shopify when authenticated. This almost solves the issue, however:import.meta.env) can't read those variables either (here, thesource op.env &&approach works).So the "easiest" solution I'm seeing for this issue is adding system environment variable support for MiniOxygen but I'm open for other suggestions. Maybe I missed something.
All reactions