Local Environment
Environment Variables
All environment variables required for local development
Open your .env.local file and fill in each value. A complete reference lives in .env.example at the project root.
# ── Convex ─────────────────────────────────────────────
# Printed by `npx convex dev` (also configured automatically)
NEXT_PUBLIC_CONVEX_URL=
# Site URL used to build owner identifiers and auth URLs
NEXT_PUBLIC_CONVEX_SITE_URL=
# ── Better Auth ────────────────────────────────────────
# Generate with: openssl rand -base64 32
BETTER_AUTH_SECRET=
# ── Google Gemini ──────────────────────────────────────
# Public key used by the client and Convex actions
NEXT_PUBLIC_GOOGLE_GEMINI_API_KEY=
# Server-side fallback key (optional)
GOOGLE_GENERATIVE_AI_API_KEY=
# ── Stripe ─────────────────────────────────────────────
# Only the secret key is required. No product/price ID is needed -
# checkout prices are created dynamically from the plan amount.
STRIPE_SECRET_KEY=
# ── PayPal ─────────────────────────────────────────────
# Sandbox: https://api-m.sandbox.paypal.com | Production: https://api-m.paypal.com
PAYPAL_API_URL=https://api-m.sandbox.paypal.com
NEXT_PUBLIC_PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=
# ── Razorpay ───────────────────────────────────────────
NEXT_PUBLIC_RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
# ── Flutterwave ────────────────────────────────────────
NEXT_PUBLIC_FLUTTERWAVE_PUBLIC_KEY=
FLUTTERWAVE_SECRET_KEY=
# ── App ────────────────────────────────────────────────
NEXT_PUBLIC_APP_URL=http://localhost:3000
# ── Resend (email) ─────────────────────────────────────
RESEND_API_KEY=
RESEND_SENDER_EMAIL=StudyStudio <noreply@yourdomain.com>
# ── Better Auth Analytics (add only AFTER deploying) ───
# BETTER_AUTH_API_KEY=The app builds and runs with most of these empty. Convex, Better Auth
(BETTER_AUTH_SECRET), and Gemini are required for a full experience. Payment
keys are only needed when you test checkout.