Environment Variables
Copy .env.example to .env.local and fill in the values relevant to your setup. Only BETTER_AUTH_SECRET is required to boot in development.
cp .env.example .env.localDatabase
Section titled “Database”| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Production only | file:rss.db | libSQL/SQLite connection string. Local dev defaults to rss.db in the project root. For Turso: libsql://your-db.turso.io |
DATABASE_AUTH_TOKEN | Only with Turso | None | Auth token for remote Turso databases. Not needed for local SQLite. |
| Variable | Required | Default | Description |
|---|---|---|---|
BETTER_AUTH_SECRET | Yes | None | Long random string used to sign sessions. Generate with openssl rand -base64 32 |
APP_URL | Recommended | http://localhost:3000 | The full public URL of your app. Used for email links and OAuth callbacks. |
VITE_AUTH_URL | Recommended | http://localhost:3000 | Client-side auth base URL. Usually the same as APP_URL. |
Set exactly one of the three keys below. SparkFeed checks in priority order: OPENAI_API_KEY → AI_GATEWAY_API_KEY → OPENROUTER_API_KEY.
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key (sk-...). Get one → |
AI_GATEWAY_API_KEY | Vercel AI SDK Gateway key. Best for Vercel-deployed apps. |
OPENROUTER_API_KEY | OpenRouter key (sk-or-...). Access to 200+ models. |
AI_MODEL | Optional. Override the default model ID for the active provider. |
See AI Providers for model lists and recommendations.
Set one email option. SparkFeed checks RESEND_API_KEY first, falls back to SMTP.
| Variable | Description |
|---|---|
EMAIL_FROM | Sender address shown in outbound emails. e.g. SparkFeed <[email protected]> |
RESEND_API_KEY | Resend API key (re_...). Get one →. Requires a verified sending domain. |
SMTP_HOST | SMTP server hostname |
SMTP_PORT | SMTP port (typically 587 for TLS, 465 for SSL) |
SMTP_USER | SMTP username |
SMTP_PASS | SMTP password |
SMTP_SECURE | true for SSL/TLS, false for STARTTLS |
SMTP_IGNORE_TLS | true to skip TLS verification (dev only, never in production) |
Demo mode
Section titled “Demo mode”| Variable | Default | Description |
|---|---|---|
VITE_DEMO_MODE | false | Set to true to boot with pre-seeded feeds and no auth. Uses an isolated database. See Demo Mode for details. |
Minimal .env.local for development
Section titled “Minimal .env.local for development”BETTER_AUTH_SECRET=your-long-random-secret-hereThat’s the absolute minimum. The database defaults to file:rss.db locally, and AI / email features are simply disabled until you add their keys.
Full example
Section titled “Full example”See .env.example in the project root for an annotated copy of every variable.