Files
supabase/apps/studio/lib/posthog.ts
T
Ivan Vasilov 4add928dae chore: Update API types (#35879)
* Regenerate all types from develop branch.

* Fix all types in studio.

* Remove extra type.
2025-05-26 15:43:14 +02:00

17 lines
550 B
TypeScript

import { components } from 'api-types'
import { hasConsented } from 'common'
import { handleError, post } from 'data/fetchers'
import { IS_PLATFORM } from './constants'
type TrackFeatureFlagVariables = components['schemas']['TelemetryFeatureFlagBody']
export async function trackFeatureFlag(body: TrackFeatureFlagVariables) {
const consent = hasConsented()
if (!consent || !IS_PLATFORM) return undefined
const { data, error } = await post(`/platform/telemetry/feature-flags/track`, { body })
if (error) handleError(error)
return data
}