Tsallaka zuwa abun ciki
Justice Tech School

Environment Variables

Vite exposes variables that start with VITE_ to the browser.

Example
const api = import.meta.env.VITE_API_URL;
fetch(api + "/users");

Exercise

Prefix.

API_URL=x

Quiz Test

Are VITE_ variables secret?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.