Improve types

This commit is contained in:
Adria Navarro 2025-04-11 13:22:04 +02:00
parent ba19492dcc
commit fddd3f0649
1 changed files with 7 additions and 4 deletions

View File

@ -2,9 +2,12 @@ import { API } from "@/api"
import PosthogClient from "./PosthogClient" import PosthogClient from "./PosthogClient"
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!)
class AnalyticsHub { class AnalyticsHub {
private initialised: boolean
private clients: PosthogClient[]
constructor() { constructor() {
this.clients = [posthog] this.clients = [posthog]
this.initialised = false this.initialised = false
@ -21,13 +24,13 @@ class AnalyticsHub {
} }
} }
identify(id) { identify(id: string) {
posthog.identify(id) posthog.identify(id)
} }
captureException(_err) {} captureException(_err: any) {}
captureEvent(eventName, props = {}) { captureEvent(eventName: string, props = {}) {
posthog.captureEvent(eventName, props) posthog.captureEvent(eventName, props)
} }