Environment Variables
All environment variables recognised by OmniSvelte and its integrations.
Environment Variables
OmniSvelte reads the following environment variables. Copy .env.example to .env and fill in your values before running pnpm dev.
Database
Authentication
OAuth providers (optional)
Email (planned)
Example .env
env
# Database
DATABASE_URL=postgres://user:password@localhost:5432/myapp
# Auth
BETTER_AUTH_SECRET=generate-a-long-random-string-here
BETTER_AUTH_URL=http://localhost:5173
# OAuth (optional)
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...Type safety
OmniSvelte generates src/omni-env.d.ts which includes ambient declarations for these variables so process.env.DATABASE_URL is typed. For SvelteKit's $env/static/private, the standard .svelte-kit/types handle that automatically. Note that Sveltekit 3+ uses $app/env/*, so we will update this when we add support for SvelteKit 3