Skip to main content
RefactKit reads configuration from environment variables at startup. For local development, create a .env.local file by copying .env.example. For production, set these variables in your hosting provider’s environment settings (for example, Vercel’s Settings → Environment Variables).

Variables by service

Database

These variables connect RefactKit to your Supabase PostgreSQL database via Drizzle ORM. Find DATABASE_URL in your Supabase project under Project Settings → Database → Connection string → URI → Transaction pooler.

Authentication

Better Auth uses these variables to sign sessions, locate your app, and secure the built-in admin dashboard.
Rotating BETTER_AUTH_SECRET in production invalidates all existing user sessions immediately. Plan any secret rotation carefully and communicate to users if needed.
Generate a secret:

Email

RefactKit sends transactional email (verification, password reset, invitations) over SMTP. The recommended provider is Resend. For Resend, your email settings will look like:
In development, Resend’s sandbox lets you send without a verified domain. For production, add DNS records (SPF, DKIM) to your domain via Resend → Domains to prevent emails landing in spam.

Storage

These variables connect RefactKit to Supabase Storage for file uploads (avatars, organization logos, gallery images).
SUPABASE_SERVICE_ROLE_KEY bypasses Supabase Row Level Security and grants full database access. Never expose it client-side. Never prefix it with VITE_. It must only be used in server functions.

Application

Full reference table

The .env.example file

The repository ships with a .env.example file showing every variable with placeholder values. Copy it to .env.local before running the app:
The full contents of .env.example:
.env.local is gitignored by default. Never commit real credentials to version control.