mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
* chore: update telemetry * Add NEXT_PUBLIC_API_URL to turbo.json. * add copy event * Update command-copy-button.tsx * Update command-copy-button.tsx * move telemetry wrapper down to child layout * update telemetry naming --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com>
20 lines
459 B
TypeScript
20 lines
459 B
TypeScript
'use client'
|
|
|
|
import { usePathname } from 'next/navigation'
|
|
import { useCallback } from 'react'
|
|
|
|
import { sendTelemetryEvent } from 'common'
|
|
import { TelemetryEvent } from 'common/telemetry-constants'
|
|
import { API_URL } from 'lib/constants'
|
|
|
|
export function useSendTelemetryEvent() {
|
|
const pathname = usePathname()
|
|
|
|
return useCallback(
|
|
(event: TelemetryEvent) => {
|
|
return sendTelemetryEvent(API_URL, event, pathname)
|
|
},
|
|
[pathname]
|
|
)
|
|
}
|