(key: string, defaultValue: string = '')
| 57 | |
| 58 | // Helper function to get config value with fallback |
| 59 | export const getConfig = (key: string, defaultValue: string = ''): string => { |
| 60 | const config = loadRuntimeConfig(); |
| 61 | |
| 62 | // 1. Check runtime config (from runtime-config.json or the generated runtime-config.js) |
| 63 | if (config && config[key]) { |
| 64 | return config[key]; |
| 65 | } |
| 66 | |
| 67 | // 2. Fallback to process.env (Server-side only) |
| 68 | return process.env[key] || defaultValue; |
| 69 | }; |
| 70 | |
| 71 | // Helper to read a cookie value by name (client-side only) |
| 72 | const getCookieValue = (name: string): string | null => { |
no test coverage detected