fix sdk version

This commit is contained in:
goenning 2023-09-01 15:24:42 +01:00
parent 47042f043b
commit ce24e8f4fb
12 changed files with 31 additions and 7 deletions

1
packages/web/src/global.d.ts vendored Normal file
View file

@ -0,0 +1 @@
declare var __APTABASE_SDK_VERSION__: string;

View file

@ -1,9 +1,9 @@
// env.PKG_VERSION is replaced by rollup during build phase
const sdkVersion = `aptabase-web@${process.env.PKG_VERSION}`;
const sdkVersion = ;
export type AptabaseOptions = {
host?: string;
appVersion?: string;
__sdkVersion?: string;
};
let _appKey = '';
@ -64,7 +64,7 @@ export function trackEvent(eventName: string, props?: Record<string, string | nu
isDebug: _isDebug,
locale: _locale,
appVersion: _options?.appVersion ?? '',
sdkVersion,
sdkVersion: globalThis.__APTABASE_SDK_VERSION__ ?? `aptabase-web@${process.env.PKG_VERSION}`,
},
props: props,
});