DEV Community

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

Collapse
 
hcmlopes profile image
hcmlopes

Doesn't it still hold true that if your app is a client side that your API key will still be exposed, or am I missing something?

Collapse
 
thedamon profile image
Damon Muma

Yes. It's security through obfuscation really, worth doing but not the ultimate solution. Ideally you own your endpoint and can hide any public keys serverside (in .env files) and route your traffic through that.

Collapse
 
turbopasi profile image
Pascal Lamers

That's true yes . But env variables can also be used for other , non-secret , things . I often use it for a development/production workflow when in development i use other endpoints than in production.