Deployment
Environment Variables
Complete reference for React Native Vibe Code environment configuration
These variables are required for the application to function:
| Variable | Description | Example |
|---|
DATABASE_URL | PostgreSQL connection string (Neon recommended) | postgresql://user:pass@ep-xxx.neon.tech/db?sslmode=require |
| Variable | Description | Example |
|---|
BETTER_AUTH_SECRET | Session encryption key (min 32 chars) | your-secret-key-here-min-32-chars |
NEXT_PUBLIC_APP_URL | Local development URL | http://localhost:3000 |
NEXT_PUBLIC_PROD_URL | Production URL | https://capsule-ide.vercel.app |
| Variable | Description | Example |
|---|
ANTHROPIC_API_KEY | Anthropic Claude API key | sk-ant-... |
| Variable | Description | Example |
|---|
E2B_API_KEY | E2B sandbox API key | e2b_... |
E2B_SANDBOX_TIMEOUT_MS | Sandbox timeout in milliseconds | 3600000 (1 hour) |
| Variable | Description | Example |
|---|
NEXT_PUBLIC_PUSHER_APP_KEY | Pusher app key (public) | abc123... |
PUSHER_APP_ID | Pusher app ID | 123456 |
PUSHER_APP_SECRET | Pusher app secret | xyz789... |
NEXT_PUBLIC_PUSHER_CLUSTER | Pusher cluster region | us2 |
These variables enable additional features:
| Variable | Description | Example |
|---|
GOOGLE_CLIENT_ID | Google OAuth client ID | ...apps.googleusercontent.com |
GOOGLE_CLIENT_SECRET | Google OAuth client secret | GOCSPX-... |
| Variable | Description | Example |
|---|
POLAR_ACCESS_TOKEN | Polar.sh API access token | polar_... |
POLAR_WEBHOOK_SECRET | Webhook signature verification | whsec_... |
NEXT_PUBLIC_POLAR_JUNIOR_PRODUCT_ID | Junior tier product ID | prod_... |
NEXT_PUBLIC_POLAR_MIDDLE_PRODUCT_ID | Middle tier product ID | prod_... |
NEXT_PUBLIC_POLAR_SENIOR_PRODUCT_ID | Senior tier product ID | prod_... |
| Variable | Description | Example |
|---|
OPENAI_API_KEY | OpenAI API key (for DALL-E, Whisper) | sk-... |
DEEPGRAM_API_KEY | Deepgram API key (live transcription) | dg_... |
| Variable | Description | Default |
|---|
NEXT_PUBLIC_REALTIME_VOICE | Use live Deepgram transcription | true |
| Variable | Description | Example |
|---|
INNGEST_EVENT_KEY | Inngest event publishing key | ... |
INNGEST_SIGNING_KEY | Inngest webhook signing key | signkey-... |
| Variable | Description | Example |
|---|
GITHUB_TOKEN | Personal access token for Git operations | ghp_... |
GITHUB_OWNER | Default GitHub organization/user | capsule-this |
| Variable | Description | Example |
|---|
EXPO_TOKEN | Expo access token for builds | expo_... |
| Variable | Description | Example |
|---|
CONVEX_OAUTH_CLIENT_ID | Convex OAuth client ID | ... |
CONVEX_OAUTH_CLIENT_SECRET | Convex OAuth client secret | ... |
CONVEX_TEAM_SCOPED_TOKEN | Team API token for provisioning | ... |
CONVEX_TEAM_SLUG | Convex team identifier | your-team |
| Variable | Description | Default |
|---|
LOCAL_DEPLOYMENT_MODE | Enable local deployment mode | false |
LOCAL_EXPO_APP_PATH | Path to local Expo app | - |
NEXT_PUBLIC_DISABLE_REFOCUS_CHECK | Disable auto health checks | false |
CHAT_HISTORY_LIMIT | Max messages to load from history | 10 |
When deploying to Vercel, add environment variables in your project settings:
- Go to your project in the Vercel Dashboard
- Navigate to Settings → Environment Variables
- Add each variable for the appropriate environments (Production, Preview, Development)
These are automatically set by Vercel and don't need manual configuration:
| Variable | Description |
|---|
VERCEL | Set to 1 when running on Vercel |
VERCEL_ENV | production, preview, or development |
VERCEL_URL | Auto-generated deployment URL |
BLOB_READ_WRITE_TOKEN | Vercel Blob access token (when Blob is enabled) |
When you add Vercel Blob storage to your project:
- Go to Storage tab in your project
- Click Create Database → Blob
- The
BLOB_READ_WRITE_TOKEN is automatically injected
Create a .env.local file in the project root:
# Copy the example file
cp .env.example .env.local
# Edit with your values
nano .env.local
For basic local development, you need at minimum:
# Database
DATABASE_URL="postgresql://..."
# Auth
BETTER_AUTH_SECRET="at-least-32-characters-long-secret"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# AI
ANTHROPIC_API_KEY="sk-ant-..."
# Sandbox
E2B_API_KEY="e2b_..."
# Pusher (for real-time updates)
NEXT_PUBLIC_PUSHER_APP_KEY="..."
PUSHER_APP_ID="..."
PUSHER_APP_SECRET="..."
NEXT_PUBLIC_PUSHER_CLUSTER="..."
- Never commit secrets - Use
.env.local (gitignored) for local development
- Use environment-specific values - Different API keys for dev/staging/prod
- Rotate secrets regularly - Especially after team member changes
- Limit access - Only grant necessary permissions for each API key
- Monitor usage - Set up alerts for unusual API usage
If you see errors about missing variables:
- Check Vercel Dashboard → Settings → Environment Variables
- Ensure variables are set for the correct environment (Production/Preview/Development)
- Redeploy after adding new variables
Variables must be prefixed with NEXT_PUBLIC_ to be available in client-side code:
# Server-only (API routes, server components)
ANTHROPIC_API_KEY="..."
# Available in browser
NEXT_PUBLIC_APP_URL="..."
- Ensure Blob storage is created in Vercel Dashboard
- Check that the project is linked to the storage
- Verify
BLOB_READ_WRITE_TOKEN is present in environment