add native and web sdks

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-11-06 08:52:58 +01:00
parent ce26b24c1b
commit 4ddafcad07
33 changed files with 812 additions and 68 deletions

View File

@@ -0,0 +1,28 @@
import type { NewMixanOptions } from '@mixan/sdk';
import { Mixan } from '@mixan/sdk';
export class MixanNative extends Mixan {
constructor(options: NewMixanOptions) {
super(options);
}
async properties() {
return {
ip: await super.ip(),
};
}
async init(properties: Record<string, unknown>) {
super.init({
...(await this.properties()),
...(properties ?? {}),
});
}
screenView(route: string, properties?: Record<string, unknown>): void {
super.event('screen_view', {
...properties,
route: route,
});
}
}