Developers

Environment Variables

General

  • We use dotenvx to load environment variables.
  • Hyprnote team uses infisical to manage them.
AGENTS.md
1# REPO="SOMEWHERE" ($HOME/repos/hyprnote inside Devin)
2infisical export \
3 --env=dev \
4 --secret-overriding=false \
5 --format=dotenv \
6 --output-file="$REPO/apps/web/.env" \
7 --projectId=87dad7b5-72a6-4791-9228-b3b86b169db1 \
8 --path="/web"

Stripe

task stripe will generate .env.stripe at the root with the following environment variables:

STRIPE_WEBHOOK_SECRET="whsec_..."

See apps/web/package.json to see how .env.stripe is used.

Supabase

task supabase-start will generate .env.supabase at the root with the following environment variables:

SUPABASE_URL="http://127.0.0.1:54321"
VITE_SUPABASE_URL="http://127.0.0.1:54321"
SUPABASE_GRAPHQL_URL="http://127.0.0.1:54321/graphql/v1"
VITE_SUPABASE_GRAPHQL_URL="http://127.0.0.1:54321/graphql/v1"
SUPABASE_STORAGE_URL="http://127.0.0.1:54321/storage/v1/s3"
VITE_SUPABASE_STORAGE_URL="http://127.0.0.1:54321/storage/v1/s3"
DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:54322/postgres"
SUPABASE_STUDIO_URL="http://127.0.0.1:54323"
SUPABASE_ANON_KEY="sb_publishable_ACJWlzQHlZjBrEguHvfOxg_3BJgxAaH"
VITE_SUPABASE_ANON_KEY="sb_publishable_ACJWlzQHlZjBrEguHvfOxg_3BJgxAaH"
SUPABASE_SERVICE_ROLE_KEY="sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz"
S3_ACCESS_KEY="625729a08b95bf1b7ff351a663f3a23c"
S3_SECRET_KEY="850181e4652dd023b7a98c58ae0d2d34bd487ee0cc3254aed6eda37307425907"
S3_REGION="local"

See apps/web/package.json, apps/api/package.json, and apps/restate/package.json to see how .env.supabase is used.

AI Server (apps/ai)

The AI server uses the envy crate for structured environment configuration. Variables are loaded from apps/ai/.env:

PORT=3001                    # Server port (default: 3001)
SUPABASE_URL="..."           # Supabase project URL
OPENROUTER_API_KEY="..."     # OpenRouter API key for LLM proxy
SENTRY_DSN="..."             # Optional: Sentry error tracking
POSTHOG_API_KEY="..."        # Optional: PostHog analytics
DEEPGRAM_API_KEY="..."       # Optional: Deepgram STT
ASSEMBLYAI_API_KEY="..."     # Optional: AssemblyAI STT
SONIOX_API_KEY="..."         # Optional: Soniox STT
FIREWORKS_API_KEY="..."      # Optional: Fireworks STT
OPENAI_API_KEY="..."         # Optional: OpenAI STT
GLADIA_API_KEY="..."         # Optional: Gladia STT
ELEVENLABS_API_KEY="..."     # Optional: ElevenLabs STT

Web App (apps/web)

The web app uses @t3-oss/env-core for validated environment variables. In development, all variables are optional. Key client-side variables:

VITE_APP_URL="..."            # App URL (default: http://localhost:3000)
VITE_API_URL="..."            # API URL (default: https://api.hyprnote.com)
VITE_SUPABASE_URL="..."       # Supabase URL
VITE_SUPABASE_ANON_KEY="..."  # Supabase anon key
VITE_POSTHOG_API_KEY="..."    # PostHog analytics key
VITE_POSTHOG_HOST="..."       # PostHog host (default: https://us.i.posthog.com)
VITE_OUTLIT_PUBLIC_KEY="..."  # Outlit pageview tracking key
VITE_SENTRY_DSN="..."         # Optional: Sentry DSN