System Design · Junior · Question 60 of 75

Why must secrets like a database password never be put in frontend code?

Explanation

Frontend env variables (NEXT_PUBLIC_, VITE_) are public. Call protected APIs through your backend.

Further reading

Problem with a question

System Design · Junior · question 60

Test yourself

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

Take this quiz