Environment Variables Reference

Configure AuthentiVoice behavior through environment variables for different deployment scenarios.

Overview

Environment variables allow you to configure AuthentiVoice without modifying code. Set these in your deployment environment, .env files, or container configurations.

Frontend Variables

React/Vite application settings

Backend Variables

FastAPI server configuration

Database Variables

PostgreSQL and Redis settings

Integration Variables

Third-party service credentials

Frontend Environment Variables

Core Configuration

Feature Flags

Frontend Examples

# Development environment
VITE_SUPABASE_URL=https://localhost.supabase.co
VITE_SUPABASE_ANON_KEY=eyJ0eXAiOi...dev-key
VITE_API_BASE_URL=http://localhost:8000
VITE_API_KEY=dev-api-key
VITE_DEMO_ENABLED=true
VITE_LOCAL_DEV=true

Backend Environment Variables

Core Configuration

Database Configuration

Storage Configuration

AI Service Configuration

  • Google Gemini
  • OpenAI
  • Whisper

Security Configuration

Integration Environment Variables

Supabase Configuration

# Required for backend
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=eyJ0eXAiOi...anon-key
SUPABASE_SERVICE_KEY=eyJ0eXAiOi...service-key

# Optional
SUPABASE_JWT_SECRET=your-jwt-secret
SUPABASE_DB_URL=postgresql://postgres:password@db.supabase.co:5432/postgres

External Services

# SMTP Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=notifications@authentivoice.com
SMTP_PASSWORD=app-specific-password
SMTP_FROM_EMAIL=noreply@authentivoice.com
SMTP_FROM_NAME=AuthentiVoice
SMTP_TLS=true

# SendGrid Alternative
SENDGRID_API_KEY=SG.actual-api-key
SENDGRID_FROM_EMAIL=noreply@authentivoice.com
# Azure AD / OneDrive
AZURE_TENANT_ID=your-tenant-id
AZURE_CLIENT_ID=your-client-id
AZURE_CLIENT_SECRET=your-client-secret
ONEDRIVE_REDIRECT_URI=https://app.authentivoice.com/auth/callback
# Webhook Settings
WEBHOOK_SECRET=your-webhook-secret
WEBHOOK_TIMEOUT=30
WEBHOOK_MAX_RETRIES=3
WEBHOOK_RETRY_DELAY=60
# Sentry Error Tracking
SENTRY_DSN=https://key@sentry.io/project-id
SENTRY_ENVIRONMENT=production
SENTRY_TRACES_SAMPLE_RATE=0.1

# Datadog APM
DD_API_KEY=your-datadog-api-key
DD_APP_KEY=your-datadog-app-key
DD_SITE=datadoghq.com

Environment File Examples

Development Environment

# Application
APP_NAME=AuthentiVoice-Dev
ENVIRONMENT=development
DEBUG=true
LOG_LEVEL=DEBUG

# Database
DATABASE_URL=postgresql://dev:devpass@localhost:5432/authentivoice_dev
REDIS_URL=redis://localhost:6379/0

# Storage
S3_ENDPOINT=http://localhost:9000
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_BUCKET=authentivoice-dev

# AI Services
GEMINI_API_KEY=dev-gemini-key
WHISPER_MODEL=tiny

# Security
SECRET_KEY=dev-secret-key-not-for-production
JWT_SECRET=dev-jwt-secret
CORS_ORIGINS=http://localhost:5173,http://localhost:3000

Best Practices

Security Best Practices
  • Never commit .env files to version control
  • Use different keys for different environments
  • Rotate secrets regularly
  • Use secret management services in production

Secret Management

  • Docker Secrets
  • Kubernetes Secrets
  • Cloud Providers
# docker-compose.yml
services:
  backend:
    environment:
      - DATABASE_URL_FILE=/run/secrets/db_url
    secrets:
      - db_url

secrets:
  db_url:
    file: ./secrets/db_url.txt

Validation Script

#!/bin/bash
# validate-env.sh - Validate required environment variables

required_vars=(
  "VITE_SUPABASE_URL"
  "VITE_SUPABASE_ANON_KEY"
  "VITE_API_BASE_URL"
  "DATABASE_URL"
  "S3_ENDPOINT"
  "S3_ACCESS_KEY"
  "S3_SECRET_KEY"
  "S3_BUCKET"
  "GEMINI_API_KEY"
)

missing_vars=()

for var in "${required_vars[@]}"; do
  if [ -z "${!var}" ]; then
    missing_vars+=("$var")
  fi
done

if [ ${#missing_vars[@]} -ne 0 ]; then
  echo "❌ Missing required environment variables:"
  printf '%s\n' "${missing_vars[@]}"
  exit 1
else
  echo "✅ All required environment variables are set"
fi

Troubleshooting

Check:
  • File name is .env (not .env.txt)
  • File is in correct directory
  • No spaces around = sign
  • Quotes for values with spaces
  • Restart application after changes
Database: Verify DATABASE_URL format and credentials Redis: Check REDIS_URL and network connectivity S3: Confirm endpoint URL and access keys APIs: Validate API keys and endpoints
Security: Ensure production secrets are properly set CORS: Verify allowed origins match your domain SSL: Check HTTPS requirements for APIs Logging: Set appropriate LOG_LEVEL

Next Steps

1

Create Environment Files

Set up .env files for each environment
2

Secure Secrets

Implement proper secret management
3

Validate Configuration

Run validation scripts before deployment
4

Document Custom Variables

Keep team documentation updated