2023-08-28 14:19:40 +02:00
|
|
|
declare const window: {
|
|
|
|
__ENV?: any
|
|
|
|
}
|
|
|
|
|
|
|
|
const isBrowser = () => Boolean(typeof window !== 'undefined' && window.__ENV)
|
|
|
|
|
|
|
|
export const getRuntimeVariable = (key: string) => {
|
|
|
|
if (isBrowser()) return window.__ENV[key]
|
2023-08-29 14:33:41 +02:00
|
|
|
if (typeof process === 'undefined') return undefined
|
2023-08-28 14:19:40 +02:00
|
|
|
return process.env[key]
|
|
|
|
}
|