budibase/packages/builder/src/analytics.js

24 lines
429 B
JavaScript
Raw Normal View History

2020-07-14 17:00:58 +02:00
import * as Sentry from "@sentry/browser"
import posthog from "posthog-js"
function activate() {
Sentry.init({ dsn: process.env.SENTRY_DSN })
posthog.init(process.env.POSTHOG_TOKEN, {
api_host: process.env.POSTHOG_URL,
})
}
function captureException(err) {
Sentry.captureException(err)
}
function captureEvent(event) {
posthog.capture(event)
}
2020-07-14 17:00:58 +02:00
export default {
activate,
captureException,
captureEvent,
2020-07-14 17:00:58 +02:00
}