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

Explanation

Values are embedded at build time and are public. Never put secrets into VITE_ variables.

Further reading

Problem with a question

Vue · Junior · question 73

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz