Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

bug: Prevent calling isInternal when not in the browser #253

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/util/isInternal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const isBrowser = typeof window !== 'undefined';

/**
* Returns true if we are currently recording an internal to Sentry replay
* (e.g. on https://sentry.io )
*/
export function isInternal() {
return ['sentry.io', 'dev.getsentry.net'].includes(window.location.host);
return (
isBrowser &&
['sentry.io', 'dev.getsentry.net'].includes(window.location.host)
);
}