Files
supabase/packages/common/telemetry-utils.ts
T
Jordi Enric 6f1cfef213 clean circular deps (#34262)
* clean circular deps in telemetry

* clean circular deps in command

* fix commandmenu circular deps

* rm deps.json

* fix consent circular dep

* fix TOC circular deps

* fix wrong import path

* fix test types

* fix missing fn

* undo let change

* fix consent component

* empty
2025-03-20 11:11:11 +01:00

18 lines
625 B
TypeScript

import { isBrowser } from './helpers'
export function getSharedTelemetryData(pathname?: string) {
return {
page_url: isBrowser ? window.location.href : '',
page_title: isBrowser ? document?.title : '',
pathname: pathname ? pathname : isBrowser ? window.location.pathname : '',
ph: {
referrer: isBrowser ? document?.referrer : '',
language: navigator.language ?? 'en-US',
user_agent: navigator.userAgent,
search: isBrowser ? window.location.search : '',
viewport_height: isBrowser ? window.innerHeight : 0,
viewport_width: isBrowser ? window.innerWidth : 0,
},
}
}