Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
chore: add analytics event for ai experiments (#4224)
Akash K40f93fc7f44f
diff --git a/packages/hoppscotch-common/src/components/collections/EditRequest.vue b/packages/hoppscotch-common/src/components/collections/EditRequest.vueindex 4ec3f1b41..0751b0f82 100644--- a/packages/hoppscotch-common/src/components/collections/EditRequest.vue+++ b/packages/hoppscotch-common/src/components/collections/EditRequest.vue@@ -115,6 +115,11 @@ const generateRequestName = async () => {isGenerateRequestNamePending.value = true+ platform.analytics?.logEvent({+ type: "EXPERIMENTS_GENERATE_REQUEST_NAME_WITH_AI",+ platform: "rest",+ })+const result = await generateRequestNameForPlatform(JSON.stringify(props.requestContext))diff --git a/packages/hoppscotch-common/src/components/collections/graphql/EditRequest.vue b/packages/hoppscotch-common/src/components/collections/graphql/EditRequest.vueindex 87a905a51..4872cd0a7 100644--- a/packages/hoppscotch-common/src/components/collections/graphql/EditRequest.vue+++ b/packages/hoppscotch-common/src/components/collections/graphql/EditRequest.vue@@ -114,6 +114,11 @@ const generateRequestName = async () => {isGenerateRequestNamePending.value = true+ platform.analytics?.logEvent({+ type: "EXPERIMENTS_GENERATE_REQUEST_NAME_WITH_AI",+ platform: "gql",+ })+const result = await generateRequestNameForPlatform(JSON.stringify(props.requestContext))diff --git a/packages/hoppscotch-common/src/platform/analytics.ts b/packages/hoppscotch-common/src/platform/analytics.tsindex 60ddd4cf2..96d5fb795 100644--- a/packages/hoppscotch-common/src/platform/analytics.ts+++ b/packages/hoppscotch-common/src/platform/analytics.ts@@ -63,6 +63,10 @@ export type AnalyticsEvent =| ({type: "HOPP_SPOTLIGHT_SESSION"} & HoppSpotlightSessionEventData)+ | {+ type: "EXPERIMENTS_GENERATE_REQUEST_NAME_WITH_AI"+ platform: "rest" | "gql"+ }export type AnalyticsPlatformDef = {initAnalytics: () => void