Choorai

Environment Variable Basics

Managing config values outside code prevents common deployment mistakes.

Core distinctions

  • Build-time: Value injected during build
  • Runtime: Value read from running server environment
  • Secret: Sensitive key/token (never commit)

Set env vars by OS

Set temporary variables in terminal session, then persist in zsh config.

# temporary
export VITE_API_URL="https://api.example.com"

# persistent (zsh)
echo 'export VITE_API_URL="https://api.example.com"' >> ~/.zshrc
source ~/.zshrc
  • Vite exposes only variables prefixed with VITE_ to client code.

Last updated: February 22, 2026 · Version: v0.0.1

Send Feedback

Opens a new issue page with your message.

Open GitHub Issue