chore(common): analytics on spotlight (#3727)

Co-authored-by: amk-dev <akash.k.mohan98@gmail.com>
This commit is contained in:
James George
2024-02-02 15:32:06 +05:30
committed by GitHub
parent aab76f1358
commit d7cdeb796a
10 changed files with 267 additions and 76 deletions

View File

@@ -5,6 +5,15 @@ export type HoppRequestEvent =
}
| { platform: "wss" | "sse" | "socketio" | "mqtt" }
export type HoppSpotlightSessionEventData = {
action?: "success" | "close"
inputLength?: number
method?: "keyboard-shortcut" | "click-spotlight-bar"
rank?: string | null
searcherID?: string | null
sessionDuration?: string
}
export type AnalyticsEvent =
| ({ type: "HOPP_REQUEST_RUN" } & HoppRequestEvent)
| {
@@ -46,6 +55,9 @@ export type AnalyticsEvent =
| { type: "HOPP_EXPORT_ENVIRONMENT"; platform: "rest" | "gql" }
| { type: "HOPP_REST_CODEGEN_OPENED" }
| { type: "HOPP_REST_IMPORT_CURL" }
| ({
type: "HOPP_SPOTLIGHT_SESSION"
} & HoppSpotlightSessionEventData)
export type AnalyticsPlatformDef = {
initAnalytics: () => void