What Are Environment Variables?
Environment variables allow an application to use configuration values that can change between environments, such as development and production.
With Vite, variables exposed to browser code normally use the VITE_ prefix.
Critical Security Rule
Frontend environment variables are not secret. Anything included in browser JavaScript can potentially be inspected by users.
- Public API base URLs can be exposed.
- Private database passwords must never be exposed.
- Secret server API keys must stay on the server.
- Authentication secrets should be handled according to the backend security design.