I’ve set up the environment variables i nthe Netlify UI (initially uploaded them via CLI). For example, the var AUTH0_DOMAIN is set to have the same value for all scopes and all deploy contexts in the UI.
When I run things locally using a local .env file netlify build && netlify dev the .env is loaded correctly and everything works. When I comment out the variables in my local .env and run netlify dev --context production then process.env.AUTH0_DOMAIN returns ‘undefined’.
I’ve read through the docs and it seems like I’m not doing anything incorrectly. Could someone please take a look and advise if this is a bug on Netlify?
Thanks! You were correct that I didn’t have Redwood setup properly.
I want to use environment variables for this task because they will change in different environments. While the Auth0 Client ID, domain, and redirect URI don’t really need to be secure, I do want them to be different for testing vs. production.
It’s good to know that my API_SECRET or other secret env vars won’t be loaded by the client, though.