Custom Server Environment
Environment Variables
Environment variables for a custom server
Create a .env file in the project root on your server (do not commit it). The same variables as production apply:
NEXT_PUBLIC_CONVEX_URL=https://<your-project>.convex.cloud
NEXT_PUBLIC_CONVEX_SITE_URL=https://<your-project>.convex.site
BETTER_AUTH_SECRET=<random secret>
NEXT_PUBLIC_GOOGLE_GEMINI_API_KEY=your-gemini-key
GOOGLE_GENERATIVE_AI_API_KEY=your-gemini-key
STRIPE_SECRET_KEY=sk_live_...
PAYPAL_API_URL=https://api-m.paypal.com
NEXT_PUBLIC_PAYPAL_CLIENT_ID=your-client-id
PAYPAL_CLIENT_SECRET=your-secret
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_live_...
RAZORPAY_KEY_SECRET=your-secret
NEXT_PUBLIC_FLUTTERWAVE_PUBLIC_KEY=FLWPUBK-...
FLUTTERWAVE_SECRET_KEY=FLWSECK-...
NEXT_PUBLIC_APP_URL=https://yourdomain.com
RESEND_API_KEY=your-resend-key
RESEND_SENDER_EMAIL=StudyStudio <noreply@yourdomain.com>Also set BETTER_AUTH_SECRET, RESEND_API_KEY, RESEND_SENDER_EMAIL, and
GOOGLE_GENERATIVE_AI_API_KEY in your Convex dashboard environment so your
Convex functions can read them.