⚙️ Environment Variables Setup Guide
Complete environment configuration for the PassItOn Admin Dashboard with current working keys.
📌 Current Environment Variables
Copy this exact configuration to your .env.local file:
<div style="background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">🔐 Clerk Authentication</span>
</div>
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key_here
CLERK_SECRET_KEY=sk_test_your_clerk_secret_key_here
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/onboarding
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL=/dashboard
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL=/onboarding
<div style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">🗄️ Supabase Database</span>
</div>
SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key_here
<div style="background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">🔧 Stripe Configuration</span>
</div>
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key_here
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key_here
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
<div style="background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">🔧 Application Configuration</span>
</div>
NEXT_PUBLIC_APP_URL=http://localhost:3000
<div style="background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">📌 Super Admin Creation Options (Choose ONE method)</span>
</div>
<div style="background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">🔐 Method 1: Environment variable with authorized emails (most secure)</span>
</div>
SUPER_ADMIN_EMAILS=tfortner@banyanlabs.io,thalsell@banyanlabs.io,scallins@banyanlabs.io
<div style="background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">📌 Method 2: First user becomes super admin (if no super admins exist)</span>
</div>
ENABLE_FIRST_USER_SUPER_ADMIN=false
<div style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">📌 Method 3: Secret key for emergency super admin creation</span>
</div>
SUPER_ADMIN_SECRET=your_super_secret_key_here
ENABLE_SECRET_URL_CREATION=false
<div style="background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">📌 Email Service (Optional - Currently Commented Out)</span>
</div>
<div style="background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; padding: 2rem; border-radius: 12px; margin-bottom: 2rem;">
<span style="font-size: 2.5rem; font-weight: 800;">🔌 RESEND_API_KEY=re_your_api_key_here</span>
</div>📌 Variable Explanations
🔐 Clerk Authentication
🗄️ Supabase Database
📌 Stripe Payments
📌 Application Settings
📌 Super Admin Creation Options
Method 1: Environment Variable (Recommended)
- SUPER_ADMIN_EMAILS: Comma-separated list of authorized super admin emails
- Most secure method - only specified emails can become super admins
- Example:
tfortner@banyanlabs.io,thalsell@banyanlabs.io
Method 2: First User Super Admin
- ENABLE_FIRST_USER_SUPER_ADMIN: Set to
trueto enable - First person to sign up becomes super admin if none exist
- Good for initial setup, less secure for production
Method 3: Secret Key Emergency Access
- SUPER_ADMIN_SECRET: Set a secure secret key
- ENABLE_SECRET_URL_CREATION: Set to
trueto enable - Access via
/create-super-adminwith secret key - For emergency situations only
⚙️ Setup Instructions
-
Create Environment File:
cp .env.example .env.local # or create new file -
Copy Configuration: Paste the exact configuration above into
.env.local -
Start Development:
npm install npm run dev
-
Verify Setup: Check that the app loads at
http://localhost:3000
📌 Service Dashboards
📌 Active Services
🗄️ Database Access
📌 Adding New Developers
When adding new team members:
- Share this document - Contains all working keys
- Verify access - Ensure they can access service dashboards
- Test setup - Have them run
npm run devto confirm everything works - Database permissions - Confirm they can access Supabase tables
🚀 Production Deployment
For production, you'll need to:
- Get live keys from each service (replace
testwithlive) - Update URLs to production domains
- Set environment variables in your deployment platform
- Configure webhooks to point to production endpoints
📌 Missing Services
📌 Email Service (Resend)
- Sign up: resend.com
- Get API key: Dashboard → API Keys
- Uncomment: Remove
#fromRESEND_API_KEYline - Add key: Replace
re_your_api_key_herewith actual key
🔍 Troubleshooting
📌 Common Issues
App won't start:
- Check all variables are set
- Restart development server:
npm run dev
Database errors:
- Verify Supabase URL and keys are correct
- Check database is accessible at dashboard
Authentication fails:
- Confirm Clerk keys match dashboard
- Verify redirect URLs are configured
Stripe errors:
- Test keys should start with
sk_test_andpk_test_ - Check webhook endpoints are configured
🧪 Quick Test
📌 Verify variables are loaded
🔒 Security Notes
- Development keys: Current keys are for development/testing only
- Never commit:
.env.localshould never be committed to version control - Production keys: Use separate live keys for production deployment
- Service role key: Has admin access - handle with care