Merge branch 'master' into BUDI-9237

This commit is contained in:
Mike Sealey 2025-04-11 14:26:16 +01:00 committed by GitHub
commit 2664bf4f7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"$schema": "node_modules/lerna/schemas/lerna-schema.json", "$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.8.6", "version": "3.9.0",
"npmClient": "yarn", "npmClient": "yarn",
"concurrency": 20, "concurrency": 20,
"command": { "command": {

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)
} }

View File

@ -48,7 +48,7 @@ class AuthStore extends BudiStore<PortalAuthStore> {
analytics analytics
.activate() .activate()
.then(() => { .then(() => {
analytics.identify(user._id) analytics.identify(user._id!)
}) })
.catch(() => { .catch(() => {
// This request may fail due to browser extensions blocking requests // This request may fail due to browser extensions blocking requests