All jobs / Frontend / web developer / Tooling

Frontend / web developer interview question · 1–3 years

You need an API base URL in a Vite app without leaking a private key. What do you do?

The strongest answer

Expose only public values via import.meta.env.VITE_* ; keep secrets on the server

Why it works

Anything with the Vite public prefix is in the browser bundle. Base URLs yes; private keys no.

What a good answer covers

Answers that fall short

Who gets asked this

More Tooling questions