Notebook Studio
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_...
STRIPE_WEBHOOK_SECRET=whsec_...
PAYPAL_API_URL=https://api-m.paypal.com
NEXT_PUBLIC_PAYPAL_CLIENT_ID=your-client-id
PAYPAL_CLIENT_SECRET=your-secret
PAYPAL_WEBHOOK_ID=your-webhook-id
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_live_...
RAZORPAY_KEY_SECRET=your-secret
RAZORPAY_WEBHOOK_SECRET=your-webhook-secret
NEXT_PUBLIC_FLUTTERWAVE_PUBLIC_KEY=FLWPUBK-...
FLUTTERWAVE_SECRET_KEY=FLWSECK-...
FLUTTERWAVE_SECRET_HASH=your-webhook-hash
NEXT_PUBLIC_DODO_ENV=live_mode
DODO_PAYMENTS_API_KEY=your-live-api-key
DODO_PAYMENTS_WEBHOOK_KEY=your-webhook-signing-key
NEXT_PUBLIC_PADDLE_ENV=production
NEXT_PUBLIC_PADDLE_CLIENT_TOKEN=live_...
PADDLE_API_KEY=pdl_live_apikey_...
PADDLE_WEBHOOK_SECRET=your-webhook-secret
NEXT_PUBLIC_APP_URL=https://yourdomain.com
NEXT_PUBLIC_SHOW_DOCS=false # set "true" to enable the docs site and its header/footer links (default: hidden)
RESEND_API_KEY=your-resend-key
RESEND_SENDER_EMAIL=Notebook Studio <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. Every payment gateway secret must be set there too, because the webhooks and the subscription-cancel action run inside Convex.