Spaces:
Sleeping
Sleeping
Download src/config/APIKeys.ts from lamsaoganh/teamta: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/lamsaoganh/teamta/resolve/main/src/config/APIKeys.ts
- Command line
-
hf download hf://spaces/lamsaoganh/teamta/src/config/APIKeys.ts
-
curl -L -o APIKeys.ts https://huggingface.co/spaces/lamsaoganh/teamta/resolve/main/src/config/APIKeys.ts
1.18 kB
| /** | |
| * ๐ 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'); | |
| } | |