-
Notifications
You must be signed in to change notification settings - Fork 12k
Sensitive environment variables #3336
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
Comments
I agreed with using dotenv, but not for storing sensitive information using dotenv really helps with many environments and is scalable, and more importantly, we can migrate from cli to other starters (and vice-verca) without much problem since dotenv is much standard and widely used. even create-react-app bundled dotenv by default https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env |
Y'know I didn't realize how dumb of a question I had asked until just now. Of course you're not going to be able to use dotenv in a client side app. You're not going to access environment variables on the clients machine. And yeah... Obviously not going to store sensitive data there either. |
Well, some key like firebase apiKey, is non-secret, and can be bundled to client-side code, since they have domain whitelist mechanism. Using dotenv in a client side app is possible, like create-react-app, but you still store secret information on server side. |
I was just thinking about not committing certain settings to the repository and dotenv enables that. But I didn't consider that anything you put in dotenv will need to be in your compiled code anyways. So I guess the real question is, what does dotenv provide that the current environment configuration in the CLI doesn't? |
well, if the env is used for things like debug flag, production flag, or API url, then current configuration is enough, but since it's committed to source control, then it'll affect other developers that uses the same environment. (much like if you commit your own IDE config) |
I tried with the dotenv package, and several webpack plugins unsuccessfully. Anyone tried these packages: webpack-dotenv-plugin and dotenv-webpack? I want to inject some environment api keys to my Angular services but I'm not be able to do it. |
Example starter using dotenv |
Discussion on how to do this sort of thing can be found in #3855. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Hi guys,
I am wondering if there is any plan to support something like dotenv
It would be nice to be able to store sensitive environment settings (e.g. api keys) this way. It's a really helpful npm package and would make a great addition to the CLI.
Thanks!
The text was updated successfully, but these errors were encountered: