/** * šŸ” API KEYS CONFIGURATION * * Centralized API keys management from environment variables. * All API keys should be stored in .env file and loaded via this module. * * NEVER hard-code API keys in source code! */ /** * Validate that all required API keys are present * Should be called at application startup */ export function validateAPIKeys(): { valid: boolean; missing: string[] } { const missing: string[] = []; return { valid: missing.length === 0, missing }; } /** * Throw error if API keys are missing (strict mode) * Use this in production to fail-fast */ export function requireAPIKeys(): void { const validation = validateAPIKeys(); if (!validation.valid) { console.error('āŒ MISSING REQUIRED API KEYS:'); validation.missing.forEach(key => { console.error(` - ${key}`); }); console.error('\nšŸ’” Add these keys to your .env file'); console.error(' See .env.example for reference\n'); throw new Error(`Missing required API keys: ${validation.missing.join(', ')}`); } console.log('āœ… All required API keys are configured'); }