Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Integrated Sentry error tracking

Blue Mouse738a299c3ade
diff --git a/package.json b/package.json
index a3a0a5c12..a54263c12 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,8 @@
"@craco/craco": "^6.2.0",
"@headlessui/react": "^1.4.0",
"@heroicons/react": "^1.0.3",
+ "@sentry/react": "^6.11.0",
+ "@sentry/tracing": "^6.11.0",
"@tailwindcss/forms": "^0.3.3",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
diff --git a/src/index.js b/src/index.js
index 28d2d1531..682dbf20d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -4,14 +4,22 @@ import { BrowserRouter } from 'react-router-dom'
import { store } from 'redux/store'
import { Provider } from 'react-redux'
import { transitions, positions, Provider as AlertProvider } from 'react-alert'
-import AlertTemplate from 'ui/Alert'
+import * as Sentry from '@sentry/react'
+import { Integrations } from '@sentry/tracing'
import 'billboard.js/dist/billboard.min.css'
import 'prismjs/themes/prism-tomorrow.css'
+import AlertTemplate from 'ui/Alert'
import App from './App'
import reportWebVitals from './reportWebVitals'
import './index.css'
+Sentry.init({
+ dsn: 'https://[email protected]/5865898',
+ integrations: [new Integrations.BrowserTracing()],
+ tracesSampleRate: 1.0,
+})
+
const options = {
position: positions.BOTTOM_RIGHT,
timeout: 7000,
@@ -28,7 +36,9 @@ ReactDOM.render(
<AlertProvider template={AlertTemplate} {...options}>
<Provider store={store}>
<BrowserRouter>
- <App />
+ <Sentry.ErrorBoundary fallback={<p>The app crashed.. :(<br/>Please, tell us about it at [email protected]</p>}>
+ <App />
+ </Sentry.ErrorBoundary>
</BrowserRouter>
</Provider>
</AlertProvider>