au1h
Reference

Configuration

Every environment variable the au1h server reads.

Set these in apps/server/.env (see .env.example).

Required

VariableDescription
DATABASE_URLPostgres connection string
REDIS_URLRedis URL (default redis://localhost:6379)
BETTER_AUTH_SECRETSigns cookies, encrypts the JWT private key. Changing it invalidates both
BETTER_AUTH_URLPublic base URL; also the JWT iss
CORS_ORIGINAdmin portal origin(s), comma-separated

Environment

VariableDefaultDescription
PORT4444
NODE_ENVdevelopmentproduction enables secure cookies, Better Auth's rate limiter, and the private-backend policy.
LOG_LEVELdebug / info in production

Admin portal

VariableDefaultDescription
AU1H_ADMIN_APP_SLUGau1h-adminReserved slug the portal sends. Must match VITE_AU1H_ADMIN_APP_SLUG in apps/web
AU1H_ADMIN_EMAILSemptyComma-separated emails and @domains allowed to sign up as admins

Proxy

VariableDefaultDescription
AU1H_PROXY_TIMEOUT_MS30000Backend fetch timeout; 504 on expiry
AU1H_PROXY_ALLOW_PRIVATE_BACKENDStrue in dev, false in prodAllow loopback/private route targets

Rate limits

Per client IP per minute, Redis-backed.

VariableDefaultRoutes
AU1H_RATE_LIMIT_ADMIN300/api/v1/*
AU1H_RATE_LIMIT_PROXY600/proxy/* (+ slug)
AU1H_RATE_LIMIT_APPS600/api/apps/* (+ slug)
AU1H_AUTH_RATE_LIMITon in productionBetter Auth's limiter on /api/auth/* (3 sign-ins / 10 s / IP)
AU1H_TRUST_PROXYfalseHonour x-forwarded-for for limiting

Email

See Email for what is sent and when.

VariableDefaultDescription
EMAIL_PROVIDERconsoleconsole (log only), smtp, resend, or memory (tests)
EMAIL_FROM_ADDRESSSender, e.g. "My Product" <[email protected]>
SMTP_URLsmtp://user:pass@host:587, required for smtp
RESEND_API_KEYRequired for resend
AU1H_SEND_VERIFICATION_ON_SIGNUPtrueEmail a verification link as part of sign-up
AU1H_REQUIRE_EMAIL_VERIFICATIONfalseRefuse password sign-in until the address is verified
AU1H_ADMIN_NAMEau1h adminName used in emails sent for the admin portal

OAuth providers

VariableDescription
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRETEnables GitHub sign-in when both are set
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETEnables Google sign-in when both are set
AU1H_SKIP_OAUTH_STATE_CHECKDev only: skip the OAuth state cookie check for cross-port localhost

All applications currently share these OAuth credentials.

On this page