Skip to main content

Environment Variables

Right Events uses both Next.js runtime variables and Convex-side variables.

Rules of thumb

  • Variables used from app/, components/, and lib/ usually live in .env.local.
  • Variables used from convex/ are typically configured in the Convex dashboard.
  • Public client-side values must use the NEXT_PUBLIC_ prefix.

Core web and Convex

VariablePurpose
NEXT_PUBLIC_CONVEX_URLRequired by the React client and several server routes to talk to Convex.
CONVEX_SITE_URLRequired for Convex HTTP health checks and auth setup.
NEXT_PUBLIC_CONVEX_SITE_URLFallback used by some health/auth paths.
SITE_URLCanonical app URL used in emails and auth flows.
NEXT_PUBLIC_APP_URLOptional public app URL fallback for links and templates.
NEXT_PUBLIC_BASE_URLBase URL used by some SEO and metadata paths.

Authentication

VariablePurpose
AUTH_RESEND_KEYPrimary Resend API key for OTP and magic link email auth.
RESEND_API_KEYFallback to AUTH_RESEND_KEY.
AUTH_RESEND_FROMSender address for auth emails.
RESEND_FROM_EMAILFallback sender address.
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETGoogle OAuth login.
AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRETAlternative Google OAuth variable names accepted by the auth layer.
APPLE_CLIENT_ID / APPLE_CLIENT_SECRETApple OAuth login when using a prebuilt client secret.
APPLE_TEAM_ID, APPLE_KEY_ID, APPLE_PRIVATE_KEYApple OAuth JWT-based configuration.
AUTH_APPLE_ID, AUTH_APPLE_SECRET, AUTH_APPLE_TEAM_ID, AUTH_APPLE_KEY_ID, AUTH_APPLE_PRIVATE_KEYAlternative Apple auth variable names accepted by the auth layer.

Payments

VariablePurpose
PAYSTACK_SECRET_KEY / PAYSTACK_PUBLIC_KEYPaystack checkout and payment settings.
FLUTTERWAVE_SECRET_KEY / FLUTTERWAVE_PUBLIC_KEYFlutterwave checkout and payment settings.
STRIPE_SECRET_KEYStripe server-side checkout creation.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYStripe public settings surfaced to the frontend.

AI and content generation

VariablePurpose
GEMINI_API_KEYGemini-backed AI endpoints in app/api/ai/*.
OPENROUTER_API_KEYOpenRouter-backed generation and moderation flows in Convex.
OPENROUTER_TEXT_MODELDefault text model fallback.
OPENROUTER_VISION_MODELDefault vision model fallback.
OPENROUTER_IMAGE_MODELDefault image model fallback.
OPENROUTER_IMAGE_SIZEDefault generated image size.

Email, notifications, and messaging

VariablePurpose
UNSUBSCRIBE_SECRETNotification unsubscribe token signing fallback.
APP_SECRETSecondary fallback for unsubscribe token signing.
NEXT_PUBLIC_TRACKING_URLTracking URL used by marketing links.
ZAVU_API_KEYSMS or WhatsApp provider integration in marketing and support flows.
ZAVU_BASE_URLOptional Zavu base URL override.
ZAVU_SMS_SENDERSMS sender identifier.
ZAVU_WHATSAPP_SENDERWhatsApp sender identifier.

Mobile gateway and backend proxy

VariablePurpose
BACKEND_URLBase URL for the FastAPI backend.
MOBILE_BACKEND_URLFallback backend URL for the mobile proxy.
MOBILE_BACKEND_API_KEYLegacy static gateway key accepted by /api/mobile/backend/*.
MOBILE_BACKEND_ALLOWED_ORIGINSCSV allow-list for CORS on the mobile gateway.
MOBILE_BACKEND_ALLOWED_PREFIXESCSV allow-list for proxied backend paths.
MOBILE_BACKEND_TIMEOUT_MSBackend request timeout for mobile proxy routes.
MOBILE_GATEWAY_KEYS_CACHE_TTL_MSTTL for cached database-managed mobile API keys.
MOBILE_API_KEYUsed by the mobile client, not the server.
MOBILE_API_BASE_URLBase URL consumed by mobile/api/RightEventsApiClient.ts.

Health and release operations

VariablePurpose
HEALTHCHECK_TIMEOUT_MSTimeout for /api/health downstream checks.
DEPLOYMENT_INGEST_TOKENAuth token for /railway/deployments/ingest.
ENABLE_RUNTIME_DEPLOYMENT_INGESTEnables release ingestion on startup if post-deploy hooks are unavailable.
RELEASE_VERSIONExplicit release version override.
RELEASE_SEMVER_BUMP / RELEASE_BUMPSemver bump hint for automated release ingestion.
RELEASE_VERSION_MODEVersioning mode override used by deployment ingest helpers.
DP_HUB_CRON_TOKENProtects Convex cron-style HTTP routes for DP maintenance.

Railway and CI metadata

These are not always set manually, but the app consumes them when present:

  • RAILWAY_ENVIRONMENT_NAME
  • RAILWAY_ENVIRONMENT
  • RAILWAY_PROJECT_ID
  • RAILWAY_SERVICE_ID
  • RAILWAY_ENVIRONMENT_ID
  • RAILWAY_DEPLOYMENT_ID
  • RAILWAY_DEPLOYMENT_URL
  • RAILWAY_GIT_COMMIT_SHA
  • RAILWAY_GIT_BRANCH
  • RAILWAY_GIT_COMMIT_MESSAGE
  • RAILWAY_GIT_COMMITTER
  • GITHUB_SHA
  • GITHUB_REF_NAME
  • GITHUB_ACTOR
  • CI_COMMIT_SHA
  • CI_COMMIT_BRANCH

Wallet pass backend

These are used by the FastAPI wallet pass service:

  • APPLE_TEAM_ID
  • APPLE_PASS_TYPE_ID
  • APPLE_PASS_CERT
  • APPLE_PASS_KEY
  • GOOGLE_WALLET_ISSUER_ID
  • GOOGLE_WALLET_KEY_FILE
NEXT_PUBLIC_CONVEX_URL=https://your-project.convex.cloud
CONVEX_SITE_URL=https://your-project.convex.site
SITE_URL=http://localhost:3000
AUTH_RESEND_KEY=re_xxx
AUTH_RESEND_FROM="Right Events <hello@example.com>"
BACKEND_URL=http://127.0.0.1:8001

Add payment, AI, and mobile gateway variables only when you need those flows.