What is the recommended way to store configuration secrets in a Node.js application?
- A Hard-coded in source files
- B In environment variables or a secret manager
- C In package.json
- D In a committed .env file
Answer
In environment variables or a secret manager
Secrets in source control leak through repository history and backups. A .env file may be used locally but must never be committed.





