Vue · Junior · Question 73 of 75
Which environment variables are exposed to client code in a Vite project?
const api = import.meta.env.VITE_API_URL- ✓Correct answer: Only variables prefixed with
VITE_, throughimport.meta.env - 2All variables from
.env - 3None - use
process.envat runtime
Explanation
Values are embedded at build time and are public. Never put secrets into VITE_ variables.