Skip to content

Commit

Permalink
fix(opentelemetry-core): adding web worker and ssr support
Browse files Browse the repository at this point in the history
  • Loading branch information
ryhinchey committed Mar 11, 2021
1 parent 60c04b1 commit c6199f7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import {
* Gets the environment variables
*/
export function getEnv(): Required<ENVIRONMENT> {
const _window = window as typeof window & RAW_ENVIRONMENT;
const _window = (typeof window === 'undefined'
? self
: window) as typeof window & RAW_ENVIRONMENT;
const globalEnv = parseEnvironment(_window);
return Object.assign({}, DEFAULT_ENVIRONMENT, globalEnv);
}

0 comments on commit c6199f7

Please sign in to comment.