1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Remove sentry client

This commit is contained in:
Adria Navarro 2023-10-17 11:09:15 +02:00
parent b9f77ba5e3
commit c281e3ee73
2 changed files with 2 additions and 44 deletions

View file

@ -1,37 +0,0 @@
import * as Sentry from "@sentry/browser"
export default class SentryClient {
constructor(dsn) {
this.dsn = dsn
}
init() {
if (this.dsn) {
Sentry.init({ dsn: this.dsn })
this.initalised = true
}
}
/**
* Capture an exception and send it to sentry.
* @param {Error} err - JS error object
*/
captureException(err) {
if (!this.initalised) return
Sentry.captureException(err)
}
/**
* Identify user in sentry.
* @param {String} id - Unique user id
*/
identify(id) {
if (!this.initalised) return
Sentry.configureScope(scope => {
scope.setUser({ id })
})
}
}

View file

@ -1,16 +1,14 @@
import { API } from "api"
import PosthogClient from "./PosthogClient"
import IntercomClient from "./IntercomClient"
import SentryClient from "./SentryClient"
import { Events, EventSource } from "./constants"
const posthog = new PosthogClient(process.env.POSTHOG_TOKEN)
const sentry = new SentryClient(process.env.SENTRY_DSN)
const intercom = new IntercomClient(process.env.INTERCOM_TOKEN)
class AnalyticsHub {
constructor() {
this.clients = [posthog, sentry, intercom]
this.clients = [posthog, intercom]
}
async activate() {
@ -23,12 +21,9 @@ class AnalyticsHub {
identify(id) {
posthog.identify(id)
sentry.identify(id)
}
captureException(err) {
sentry.captureException(err)
}
captureException(err) {}
captureEvent(eventName, props = {}) {
posthog.captureEvent(eventName, props)