mirror of
https://github.com/hcengineering/platform.git
synced 2025-02-12 13:52:59 +00:00
20 lines
578 B
TypeScript
20 lines
578 B
TypeScript
//
|
|
// Copyright © 2024 Hardcore Engineering Inc.
|
|
//
|
|
|
|
import { AnalyticProvider, Analytics } from '@hcengineering/analytics'
|
|
import { SentryAnalyticProvider } from './sentry'
|
|
|
|
export * from './logging'
|
|
export * from './sentry'
|
|
|
|
export function configureAnalytics (sentryDSN: string | undefined, config?: Record<string, any>): void {
|
|
const providers: AnalyticProvider[] = []
|
|
if (sentryDSN !== undefined && sentryDSN !== '') {
|
|
providers.push(new SentryAnalyticProvider(sentryDSN))
|
|
}
|
|
for (const provider of providers) {
|
|
Analytics.init(provider, config ?? {})
|
|
}
|
|
}
|