Environment Variables (Haven 2026)
Haven uses a modular environment variable structure for its distributed services.
🔑 Essential Variables
| Variable | Purpose | Location |
| :--- | :--- | :--- |
| NEXT_PUBLIC_SUPABASE_URL | Supabase API endpoint. | Root (.env) |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | Public access key for Supabase. | Root (.env) |
| SUPABASE_SERVICE_ROLE_KEY | Admin bypass key (Keep private!). | Root (.env) |
| UPSTASH_REDIS_REST_URL | Redis URL for rate limiting. | Root (.env) |
| UPSTASH_REDIS_REST_TOKEN | Redis token for rate limiting. | Root (.env) |
| LIVEKIT_API_KEY | LiveKit server key. | Root (.env) |
| LIVEKIT_API_SECRET | LiveKit server secret. | Root (.env) |
| NEXT_PUBLIC_LIVEKIT_URL | LiveKit SFU endpoint. | Root (.env) |
| NEXT_PUBLIC_MATCHMAKING_WS_URL | URL of the dedicated WS server. | Root (.env) |
| MIDDLEWARE_SECRET | Secret used to sign internal headers. | Root (.env) |
🛰️ Matchmaking Server Specifics
The dedicated WebSocket server (in matchmaking-server/) requires its own environment configuration:
PORT: Defaults to8080.X-API-KEY: Used for health checks and cross-service verification.NEW_RELIC_LICENSE_KEY: License key for performance monitoring.NEW_RELIC_APP_NAME: Name displayed in New Relic dashboard.
🏠 Local Development Tips
- Next.js: Use
.env.localto override production values. - Supabase: If developing locally, point to
http://127.0.0.1:54321. - Matchmaking: If the WS server is running locally on
localhost:8080, Next.js will auto-detect it through theNEXT_PUBLIC_MATCHMAKING_WS_URLfallback.
[!WARNING] Security: Never commit your
.envor.env.localfiles to Git. A template is provided in.env.example.
Created by the Antigravity Deployment Team.