Vercel Environment Variables Setup
Admin Panel (civ-start-admin.vercel.app)
The admin panel requires environment variables to be configured in the Vercel dashboard to connect to the production API.
Required Environment Variables
Navigate to: Vercel Dashboard → civ-start-admin project → Settings → Environment Variables
Add the following environment variables for Production, Preview, and Development environments:
# API Configuration
NEXT_PUBLIC_API_URL=https://api.civstart.ventures
NEXT_PUBLIC_API_BASE_URL=https://api.civstart.ventures
# Clerk Authentication (use production keys)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<your_production_clerk_publishable_key>
CLERK_SECRET_KEY=<your_production_clerk_secret_key>
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=/dashboard
# Environment
NODE_ENV=production
NEXT_PUBLIC_APP_ENV=production
Frontend (www.civstart.ventures)
Required Environment Variables
Navigate to: Vercel Dashboard → civstart-frontend project → Settings → Environment Variables
Add the following for Production, Preview, and Development:
# API Configuration
NEXT_PUBLIC_API_URL=https://api.civstart.ventures
NEXT_PUBLIC_API_BASE_URL=https://api.civstart.ventures
# Clerk Authentication (use production keys)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<your_production_clerk_publishable_key>
CLERK_SECRET_KEY=<your_production_clerk_secret_key>
# PostHog Analytics
NEXT_PUBLIC_POSTHOG_KEY=<your_posthog_project_key>
NEXT_PUBLIC_POSTHOG_HOST=<your_posthog_host>
Important Notes
.env.localfiles are NOT deployed to Vercel - they are only for local development- All environment variables must be set in the Vercel dashboard for each environment (Production/Preview/Development)
- After adding/updating environment variables, you need to trigger a new deployment:
- Option 1: Push a new commit to GitHub
- Option 2: Go to Deployments tab → Click "..." → Redeploy
- Use different Clerk keys for production vs development
- Verify API URLs are using
https://api.civstart.ventures(not localhost)
Troubleshooting
Admin panel still connecting to localhost
- Check Vercel dashboard environment variables are set
- Verify you're using the correct project in Vercel
- Trigger a fresh deployment after setting variables
- Check browser console for API request URLs
- Clear browser cache and hard refresh (Cmd+Shift+R / Ctrl+Shift+R)
Clerk authentication not working
- Ensure production Clerk keys are being used
- Verify Clerk dashboard has the correct domain whitelist
- Check that callback URLs are configured in Clerk dashboard
Quick Fix Commands
# View current Vercel environment variables (requires Vercel CLI)
vercel env ls
# Pull environment variables from Vercel
vercel env pull
# Deploy with fresh environment variables
vercel --prod