mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 17:00:27 -04:00
30c390c19c
* 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
442 B
TypeScript
17 lines
442 B
TypeScript
import { sendTelemetryEvent } from 'common'
|
|
import { TelemetryEvent } from 'common/telemetry-constants'
|
|
import { usePathname } from 'next/navigation'
|
|
import { useCallback } from 'react'
|
|
import { API_URL } from './constants'
|
|
|
|
export function useSendTelemetryEvent() {
|
|
const pathname = usePathname()
|
|
|
|
return useCallback(
|
|
(event: TelemetryEvent) => {
|
|
return sendTelemetryEvent(API_URL, event, pathname)
|
|
},
|
|
[pathname]
|
|
)
|
|
}
|