Skip to main content

Environment Variables

Complete reference for all environment variables used by Igris.

Required

These must be set for the application to start.
VariableDescriptionExample
DATABASE_URLNeon PostgreSQL connection stringpostgresql://user:pass@ep-cool-name.us-east-2.aws.neon.tech/igris?sslmode=require
BETTER_AUTH_SECRETSecret key for session encryption (min 32 chars)a-long-random-string-at-least-32-characters
BETTER_AUTH_URLPublic URL of the API serverhttps://igris-api.fly.dev

Redis (Upstash)

Required for policy caching, rate limiting, and SSE.
VariableDescriptionExample
UPSTASH_REDIS_REST_URLUpstash Redis REST API URLhttps://usw1-example.upstash.io
UPSTASH_REDIS_REST_TOKENUpstash Redis REST API tokenAXxxASQ...

OAuth Providers (Optional)

Enable social login. If not set, only email/password auth is available.

GitHub

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth App client ID
GITHUB_CLIENT_SECRETGitHub OAuth App client secret
Create a GitHub OAuth App at github.com/settings/developers. Set the callback URL to {BETTER_AUTH_URL}/api/auth/callback/github.

Google

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
Create credentials in the Google Cloud Console. Set the redirect URI to {BETTER_AUTH_URL}/api/auth/callback/google.

Payments (Dodo Payments)

Required for billing features. If not set, all organizations default to the Free plan.
VariableDescription
DODO_API_KEYDodo Payments API key
DODO_WEBHOOK_SECRETDodo Payments webhook signature secret

Application

VariableDefaultDescription
PORT3100Port the API server listens on
NODE_ENVdevelopmentSet to production for production deployments
TRUSTED_ORIGINSComma-separated list of allowed CORS origins (e.g., https://app.igris.dev,https://igris-api.fly.dev)

Frontend (Next.js)

Set these on the web frontend deployment:
VariableDescription
NEXT_PUBLIC_API_URLURL of the Igris API server
NEXT_PUBLIC_APP_URLPublic URL of the frontend app

Example .env File

# Database
DATABASE_URL="postgresql://igris_user:password@ep-cool-name.us-east-2.aws.neon.tech/igris?sslmode=require"

# Auth
BETTER_AUTH_SECRET="change-me-to-a-random-string-at-least-32-characters"
BETTER_AUTH_URL="http://localhost:3100"

# Redis
UPSTASH_REDIS_REST_URL="https://usw1-example.upstash.io"
UPSTASH_REDIS_REST_TOKEN="AXxxASQgODM..."

# OAuth (optional)
GITHUB_CLIENT_ID="Iv1.abc123"
GITHUB_CLIENT_SECRET="secret123"
GOOGLE_CLIENT_ID="123-abc.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="GOCSPX-secret"

# Payments (optional)
DODO_API_KEY="dodo_live_abc123"
DODO_WEBHOOK_SECRET="whsec_abc123"

# Application
PORT=3100
NODE_ENV=development
TRUSTED_ORIGINS="http://localhost:3200"
Never commit .env files to version control. Use your deployment platform’s secret management (Fly.io secrets, Vercel env vars, etc.).