mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(core): adjust subscription related mixpanel (#7536)
This commit is contained in:
@@ -2,6 +2,8 @@ import { DebugLogger } from '@affine/debug';
|
||||
import type { OverridedMixpanel } from 'mixpanel-browser';
|
||||
import mixpanelBrowser from 'mixpanel-browser';
|
||||
|
||||
import type { MixpanelEvents } from '../mixpanel';
|
||||
|
||||
const logger = new DebugLogger('affine:mixpanel');
|
||||
|
||||
export const mixpanel = process.env.MIXPANEL_TOKEN
|
||||
@@ -31,3 +33,10 @@ function createProxyHandler(property?: string | symbol) {
|
||||
} as ProxyHandler<OverridedMixpanel>;
|
||||
return handler;
|
||||
}
|
||||
|
||||
export function mixpanelTrack<T extends keyof MixpanelEvents>(
|
||||
event: T,
|
||||
properties?: MixpanelEvents[T]
|
||||
) {
|
||||
return mixpanel.track(event, properties);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user