Skip to main content

Environment Variables Configuration Guide

This document provides a comprehensive guide to all environment variables used across the Intervo application stack.

Overview

The Intervo application uses environment variables across three main packages:
  • Backend (packages/intervo-backend/) - Node.js API server
  • Frontend (packages/intervo-frontend/) - Next.js web application
  • Widget (packages/intervo-widget/) - Embeddable widget component

Backend Environment Variables

Based on packages/intervo-backend/env.example, create .env file:

Core Application Settings

Database

Twilio Communication

AI Services

Speech Services

Cloud Storage

Google Services

Frontend Environment Variables

Create .env.local in packages/intervo-frontend/:

Widget Environment Variables

Create .env in packages/intervo-widget/:

Quick Development Setup

1. Backend Setup

2. Frontend Setup

3. Widget Setup

Service Integration Guides

Twilio Setup

  1. Create account at Twilio
  2. Get Account SID and Auth Token from Console
  3. Create API Key and Secret
  4. Purchase phone number
  5. Create TwiML Application

OpenAI Setup

  1. Create account at OpenAI
  2. Generate API key from dashboard
  3. Set usage limits and billing

Stripe Setup

  1. Create account at Stripe
  2. Get publishable and secret keys
  3. Set up webhook endpoints
  4. Configure test/production modes

Speech Services

  • AssemblyAI: Get API key from AssemblyAI
  • Azure Speech: Create Speech service in Azure portal
  • ElevenLabs: Get API key from ElevenLabs

Environment-Specific Configuration

Development

  • Use test/sandbox API keys
  • Local database connection
  • HTTP URLs acceptable

Production

  • Production API keys only
  • Secure database connection
  • HTTPS URLs required
  • Strong secrets (32+ characters)

Security Best Practices

  1. Never commit .env files to version control
  2. Use different API keys per environment
  3. Rotate secrets regularly
  4. Use secure secret management in production

Troubleshooting

Common Issues

  1. Missing environment variables: Check server logs for undefined errors
  2. Frontend API connection: Verify NEXT_PUBLIC_API_URL_DEVELOPMENT
  3. Database connection: Check MONGO_URI format and MongoDB status
  4. Widget not loading: Rebuild after environment changes

Debugging

Complete Variable Reference

Backend Variables (23 total from env.example)

Additional Backend Variables (Found in codebase)

  • STRIPE_SECRET_KEY - Stripe payment processing
  • STRIPE_WEBHOOK_SECRET - Stripe webhook validation
  • BASE_URL - Application base domain
  • ENCRYPTION_KEY - Data encryption key
  • HETZNER_STORAGE_* - Hetzner cloud storage
  • DEEPGRAM_API_KEY - Deepgram speech service
  • VOYAGE_API_KEY - Voyage embeddings
  • MAILCOACH_TOKEN - Email marketing

Frontend Variables

  • NEXT_PUBLIC_API_URL_DEVELOPMENT - Dev API endpoint
  • NEXT_PUBLIC_API_URL_PRODUCTION - Prod API endpoint
  • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - Stripe public key

Widget Variables

  • VITE_API_URL_DEVELOPMENT - Dev API endpoint
  • VITE_API_URL_PRODUCTION - Prod API endpoint

This configuration enables the complete Intervo application stack with all integrations. Adjust API keys and endpoints based on your specific deployment requirements.