Remove sentry client
This commit is contained in:
parent
b9f77ba5e3
commit
c281e3ee73
|
@ -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 })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +1,14 @@
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import PosthogClient from "./PosthogClient"
|
import PosthogClient from "./PosthogClient"
|
||||||
import IntercomClient from "./IntercomClient"
|
import IntercomClient from "./IntercomClient"
|
||||||
import SentryClient from "./SentryClient"
|
|
||||||
import { Events, EventSource } from "./constants"
|
import { Events, EventSource } from "./constants"
|
||||||
|
|
||||||
const posthog = new PosthogClient(process.env.POSTHOG_TOKEN)
|
const posthog = new PosthogClient(process.env.POSTHOG_TOKEN)
|
||||||
const sentry = new SentryClient(process.env.SENTRY_DSN)
|
|
||||||
const intercom = new IntercomClient(process.env.INTERCOM_TOKEN)
|
const intercom = new IntercomClient(process.env.INTERCOM_TOKEN)
|
||||||
|
|
||||||
class AnalyticsHub {
|
class AnalyticsHub {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.clients = [posthog, sentry, intercom]
|
this.clients = [posthog, intercom]
|
||||||
}
|
}
|
||||||
|
|
||||||
async activate() {
|
async activate() {
|
||||||
|
@ -23,12 +21,9 @@ class AnalyticsHub {
|
||||||
|
|
||||||
identify(id) {
|
identify(id) {
|
||||||
posthog.identify(id)
|
posthog.identify(id)
|
||||||
sentry.identify(id)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
captureException(err) {
|
captureException(err) {}
|
||||||
sentry.captureException(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
captureEvent(eventName, props = {}) {
|
captureEvent(eventName, props = {}) {
|
||||||
posthog.captureEvent(eventName, props)
|
posthog.captureEvent(eventName, props)
|
||||||
|
|
Loading…
Reference in New Issue