DEV Community

Discussion on: How to Use Environment Variables in Vue.js

Collapse
turbopasi profile image
Pascal Lamers • Edited

You shouldn't include any secrets in your frontend/clientside code. From the official docs:

"WARNING
Do not store any secrets (such as private API keys) in your app! Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files."

During the build process all environment variables will simply be swapped with plain text. So in frontend only use env variables for non-secrets.