RefactKit reads its runtime configuration exclusively from environment variables. Before you start the development server or deploy to production, create aDocumentation Index
Fetch the complete documentation index at: https://docs.refactkit.com/llms.txt
Use this file to discover all available pages before exploring further.
.env file in the project root by copying .env.example. Never commit this file to version control — it contains secrets that must stay off public repositories.
Creating your .env file
Variable reference
Authentication
These variables configure Better Auth, which handles sessions, organizations, and RBAC across your entire application.A cryptographically random 32-character string used to sign and verify session
tokens. Generate a secure value with:Keep this value secret and consistent across all instances of the same environment. Rotating it invalidates all active sessions.
The base URL of your application, used by Better Auth to construct callback
URLs for OAuth flows and email links.
- Development:
http://localhost:3000 - Production:
https://yourdomain.com
An optional API key for authenticating server-to-server requests against the
Better Auth HTTP API. Starts with
ba. Generate one from the Better Auth
dashboard or via the CLI.Database
A PostgreSQL connection string used by Drizzle ORM to connect to your
database. RefactKit ships configured for Supabase with connection pooling
enabled.Find this value in your Supabase project under Settings → Database → Connection string → URI. Select the Transaction pooler (port
6543) for serverless deployments.Storage
RefactKit uses Supabase Storage for avatars, organization logos, and other uploaded media. All uploads are performed server-side — the service role key never reaches the browser.Your Supabase project URL, used by both the client and server to reference
storage buckets and construct public asset URLs.Find it in your Supabase project under Settings → API → Project URL.This variable is prefixed with
VITE_ and is safe to expose to the browser.Your Supabase service role key. This key bypasses Row Level Security and is
used exclusively in server functions to perform storage uploads on behalf of
users.Find it under Settings → API → Project API keys → service_role.
Your Resend API key. Generate one in the Resend dashboard under API Keys
with Sending access. The key starts with
re_.The “From” address used for all outgoing emails. Use the format
The domain must be verified in your Resend account under Domains.
Display Name <address@yourdomain.com>.App
The canonical public URL of your application. Used for constructing absolute
URLs in the frontend.
- Development:
http://localhost:3000 - Production:
https://yourdomain.com
Full .env.example reference
The following is the complete .env.example shipped with RefactKit. Copy it and replace every placeholder value before running the application.
Variables prefixed with
VITE_ are statically inlined into the client bundle
at build time. Only use this prefix for values that are safe to expose
publicly. All other variables remain server-side only.
