* cypress test setup * running cypress in CI * fixing tests after first time setup wizard * bb api key * API Key in right place * adding env in cypress.json * env var in setup * lint * API key not working * fill in API key form if present * allow more time for creation * cypress server for debug * video recording, better debugging * Adding debug logs * set node env * cypress env * cancel irrelevant test
25 lines
511 B
JavaScript
25 lines
511 B
JavaScript
import * as Sentry from "@sentry/browser"
|
|
import posthog from "posthog-js"
|
|
|
|
function activate() {
|
|
Sentry.init({ dsn: process.env.SENTRY_DSN })
|
|
if (!process.env.POSTHOG_TOKEN) return
|
|
posthog.init(process.env.POSTHOG_TOKEN, {
|
|
api_host: process.env.POSTHOG_URL,
|
|
})
|
|
}
|
|
|
|
function captureException(err) {
|
|
Sentry.captureException(err)
|
|
}
|
|
|
|
function captureEvent(event) {
|
|
if (!process.env.POSTHOG_TOKEN) return
|
|
posthog.capture(event)
|
|
}
|
|
|
|
export default {
|
|
activate,
|
|
captureException,
|
|
captureEvent,
|
|
}
|