46884e3fec
* fix: remove vega_rest from monorepo * fix: mainnet api urls * fix: remove redundant vega url from token config * fix: lint * chore: remove redundant env props from token app * fix: format
21 lines
605 B
TypeScript
21 lines
605 B
TypeScript
const windowOrDefault = (key: string, defaultValue?: string) => {
|
|
if (typeof window !== 'undefined') {
|
|
if (window._env_ && window._env_[key]) {
|
|
return window._env_[key];
|
|
}
|
|
}
|
|
return defaultValue || '';
|
|
};
|
|
|
|
/**
|
|
* Need to have default value as next in-lines environment variables. Cannot figure out dynamic keys.
|
|
* So must provide the default with the key so that next can figure it out.
|
|
*/
|
|
export const ENV = {
|
|
envName: windowOrDefault('NX_VEGA_ENV', process.env['NX_VEGA_ENV']),
|
|
dsn: windowOrDefault(
|
|
'NX_TRADING_SENTRY_DSN',
|
|
process.env['NX_TRADING_SENTRY_DSN']
|
|
),
|
|
};
|