Orbit

Configuration

Every environment variable, what it does, and which ones you need in production.

Copy .env.example to .env.local and fill in what you need. Everything is optional in development.

Environment variables

VariableNeeded in productionWhat it does
DATABASE_URLYesPostgres connection string, for example from Neon. When it is empty, Orbit uses the embedded database in .data/.
APP_URLYesThe public address of your site, such as https://app.example.com. It is used in emailed links. On Vercel, the production domain is used automatically if this is empty.
RESEND_API_KEYFor emailSends real email through Resend. Without it, emails are printed to the server console.
MAIL_FROMWith ResendThe sender, for example Orbit <hello@example.com>.
CONTACT_TOOptionalEmail address that receives contact-form messages. They are always saved and shown in the admin area.
ADMIN_EMAILSOptionalComma-separated emails allowed to open /admin. The admin area is off when this is empty.
CRON_SECRETFor scheduled jobsProtects the alert and weekly-report jobs. Without it they are disabled.
STRIPE_SECRET_KEYFor real billingTurns on Stripe. Without it, billing runs in demo mode. See Billing.
STRIPE_WEBHOOK_SECRETWith StripeVerifies webhook calls from Stripe.
STRIPE_PRICE_GROWTH_MONTH and the other three price idsWith StripeOne price id for each paid plan and billing period.
ANTHROPIC_API_KEYFor the AI assistantLets Ask Orbit use Claude. Without it, a built-in analyst answers. See AI assistant.
ORBIT_AI_MODELOptionalThe Claude model to use. The default is a fast, low-cost model.
ORBIT_DEMODemo sites onlyShows reset and invite links on screen instead of emailing them. Never set this on a site with real users.
ORBIT_PUBLIC_DEMODemo sites onlySet to 1 to show a "Try the live demo" button on the login page. It opens a shared, view-only workspace with sample data, no sign-up needed. Leave it unset on a real product.
PGLITE_DIROptionalFolder for the embedded database. Default .data/orbit.

Why the database switches by itself

lib/db.ts exposes one query() function. If DATABASE_URL is set it talks to Neon, otherwise to the embedded database. The same SQL runs on both, so what you test locally behaves the same in production. Tables are created automatically on first use from lib/schema.ts.

Email

Add RESEND_API_KEY and MAIL_FROM. Emails sent: password reset, team invites, alert notices and the weekly report. To use another provider, change the one function in lib/mail.ts.

Scheduled jobs

Two endpoints do scheduled work. Both need CRON_SECRET and an Authorization: Bearer <secret> header.

EndpointPurposeSuggested schedule
/api/cron/alertsChecks every workspace's alert rulesDaily, or hourly on a paid Vercel plan
/api/cron/weeklyEmails the weekly summaryMonday morning

vercel.json already contains these schedules. Vercel Cron sends the secret for you when CRON_SECRET is set.