Config & Env Vars
Prax uses environment variables to manage configuration for:
LLM providers (OpenAI, Azure, etc.)
Databases (Postgres, SQLite)
Redis or memory backends
Feature toggles (auth, logging)
Setup
Create a .env
file in the root of the project:
bashCopyEditcp .env.example .env
Common Environment Variables
envCopyEdit# API Keys
OPENAI_API_KEY=sk-...
# Database
DATABASE_URL=postgres://user:pass@host:5432/db
# Optional Features
ENABLE_AUTH=true
LOG_LEVEL=debug
# Server Settings
PORT=3001
FRONTEND_URL=http://localhost:3000
Backend Access
Env vars are read using process.env
:
tsCopyEditconst apiKey = process.env.OPENAI_API_KEY
Frontend Access
Frontend variables must be prefixed with VITE_
(if using Vite):
envCopyEditVITE_FRONTEND_NAME=“Prax Dev”
Accessed with:
tsCopyEditimport.meta.env.VITE_FRONTEND_NAME
Last updated