mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add sentry integration (#1141)
This commit is contained in:
parent
b7f681a068
commit
4ecbbab7da
8 changed files with 190 additions and 112 deletions
|
@ -1,10 +1,29 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import * as Sentry from "@sentry/browser";
|
||||
import { TopErrorBoundary } from "./components/TopErrorBoundary";
|
||||
import { IsMobileProvider } from "./is-mobile";
|
||||
import { App } from "./components/App";
|
||||
import "./styles.scss";
|
||||
|
||||
const SentyEnvHostnameMap: { [key: string]: string } = {
|
||||
"excalidraw.com": "production",
|
||||
"now.sh": "staging",
|
||||
};
|
||||
|
||||
const onlineEnv = Object.keys(SentyEnvHostnameMap).find(
|
||||
(item) => window.location.hostname.indexOf(item) >= 0,
|
||||
);
|
||||
|
||||
Sentry.init({
|
||||
// Disable Sentry locally to avoid noise
|
||||
dsn: onlineEnv
|
||||
? "https://7bfc596a5bf945eda6b660d3015a5460@sentry.io/5179260"
|
||||
: undefined,
|
||||
environment: onlineEnv ? SentyEnvHostnameMap[onlineEnv] : undefined,
|
||||
release: process.env.REACT_APP_GIT_SHA,
|
||||
});
|
||||
|
||||
// Block pinch-zooming on iOS outside of the content area
|
||||
document.addEventListener(
|
||||
"touchmove",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue