Move source to top level
This commit is contained in:
@@ -94,7 +94,6 @@ const Context = createContext<AnalyticsBaseContextType>({
|
||||
})
|
||||
},
|
||||
metadata: {
|
||||
source: 'app',
|
||||
base: {
|
||||
deviceId: getDeviceId() ?? 'unknown',
|
||||
sessionId: getInitialSessionId(),
|
||||
|
||||
@@ -34,7 +34,6 @@ export type MergeableMetadata = {
|
||||
}
|
||||
|
||||
export type Metadata = {
|
||||
source: 'app'
|
||||
base: BaseMetadata
|
||||
geolocation: GeolocationMetadata
|
||||
} & MergeableMetadata
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Logger} from '#/logger'
|
||||
import * as env from '#/env'
|
||||
|
||||
type Event<M extends Record<string, any>> = {
|
||||
source: 'app'
|
||||
time: number
|
||||
event: keyof M
|
||||
payload: M[keyof M]
|
||||
@@ -43,7 +44,8 @@ export class MetricsClient<M extends Record<string, any>> {
|
||||
) {
|
||||
this.start()
|
||||
|
||||
const e = {
|
||||
const e: Event<M> = {
|
||||
source: 'app',
|
||||
time: Date.now(),
|
||||
event,
|
||||
payload,
|
||||
|
||||
Reference in New Issue
Block a user