- Created EMAIL_DEBUG_SUMMARY.md with detailed analysis of email service issue - Added enhanced logging to admin routes and email service - Identified root cause: malformed email address concatenation - Documented all debugging attempts and next steps - Added route access logging to trace request flow - Removed problematic catch-all route that was causing 404s
2.0 KiB
2.0 KiB
Firebase Functions Environment Variables
When deploying to Firebase Functions, make sure to set these environment variables:
Required Environment Variables
# Supabase Configuration (for database)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_KEY=your-supabase-service-key
# Google Cloud Configuration
GCLOUD_PROJECT_ID=your-project-id
DOCUMENT_AI_LOCATION=us
DOCUMENT_AI_PROCESSOR_ID=your-processor-id
GCS_BUCKET_NAME=your-gcs-bucket
DOCUMENT_AI_OUTPUT_BUCKET_NAME=your-output-bucket
# LLM Configuration
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=your-anthropic-key
OPENAI_API_KEY=your-openai-key
# JWT Configuration
JWT_SECRET=your-jwt-secret
JWT_REFRESH_SECRET=your-refresh-secret
# Firebase Configuration
FB_PROJECT_ID=your-firebase-project-id
FB_STORAGE_BUCKET=your-firebase-bucket
Setting Environment Variables in Firebase
Option 1: Firebase CLI
firebase functions:config:set supabase.url="https://your-project.supabase.co"
firebase functions:config:set supabase.anon_key="your-anon-key"
firebase functions:config:set supabase.service_key="your-service-key"
# ... set other variables
Option 2: Firebase Console
- Go to Firebase Console
- Select your project
- Go to Functions > Configuration
- Add environment variables in the "Environment variables" section
Option 3: .env file (for local development)
Create a .env file in the backend directory with all the variables above.
Database Setup for Firebase
After deploying to Firebase, run the database setup:
# For Firebase deployment
npm run db:setup-sharing-firebase
Important Notes
- Service Account: Firebase Functions automatically use the default service account
- Database Connection: Uses direct PostgreSQL connection to Supabase
- Authentication: Firebase Auth tokens are automatically handled
- Cold Starts: Consider using Firebase Functions with higher memory allocation for better performance