give global properties __ prefix to easier find them

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-28 10:21:37 +01:00
parent 3679caf547
commit a898cfb14a
8 changed files with 49 additions and 399 deletions

View File

@@ -1,8 +1,11 @@
import Script from 'next/script';
import type { MixanEventOptions } from '@mixan/sdk';
import type { MixanWebOptions } from '@mixan/sdk-web';
import type { UpdateProfilePayload } from '@mixan/types';
import type {
MixanEventOptions,
PostEventPayload,
UpdateProfilePayload,
} from '@mixan/types';
const CDN_URL = 'http://localhost:3002/op.js';
@@ -73,11 +76,14 @@ export function SetProfileId({ value }: SetProfileIdProps) {
);
}
export function trackEvent(name: string, data?: Record<string, unknown>) {
export function trackEvent(
name: string,
data?: PostEventPayload['properties']
) {
window.op('event', name, data);
}
export function trackScreenView(data?: Record<string, unknown>) {
export function trackScreenView(data?: PostEventPayload['properties']) {
trackEvent('screen_view', data);
}