fix(sdks): ensure nextjs exports all methods

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-01 10:04:02 +02:00
parent da9df80079
commit c0a0f23a33
3 changed files with 19 additions and 6 deletions

View File

@@ -96,15 +96,25 @@ export function useOpenPanel() {
increment,
decrement,
clear,
setGlobalProperties,
};
}
function setGlobalProperties(properties: Record<string, unknown>) {
window.op?.('setGlobalProperties', properties);
}
function track(name: string, properties?: TrackProperties) {
window.op?.('track', name, properties);
}
function screenView(properties: TrackProperties) {
track('screen_view', properties);
function screenView(properties?: TrackProperties): void;
function screenView(path: string, properties?: TrackProperties): void;
function screenView(
pathOrProperties?: string | TrackProperties,
propertiesOrUndefined?: TrackProperties,
) {
window.op?.('screenView', pathOrProperties, propertiesOrUndefined);
}
function identify(payload: IdentifyPayload) {