mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
* chore: unify telemetry event sending * organize some imports * remove final useTelemetryProps * add www telemetry actions typing and docs * remove gaevents * fix build * move telemetry identify into PageTelemetry * fix telemetry constants import --------- Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
17 lines
448 B
TypeScript
17 lines
448 B
TypeScript
import { sendTelemetryEvent } from 'common'
|
|
import { TelemetryEvent } from 'common/telemetry-constants'
|
|
import { API_URL } from 'lib/constants'
|
|
import { useRouter } from 'next/router'
|
|
import { useCallback } from 'react'
|
|
|
|
export function useSendTelemetryEvent() {
|
|
const router = useRouter()
|
|
|
|
return useCallback(
|
|
(event: TelemetryEvent) => {
|
|
return sendTelemetryEvent(API_URL, event, router.pathname)
|
|
},
|
|
[router.pathname]
|
|
)
|
|
}
|