Files
supabase/packages/common
Sean Oliver ce00372b40 chore(studio): add telemetry for data API access toggle rollout (#43913)
## Problem

PR #43704 added the `tableEditorApiAccessToggle` flag to revoke default
privileges on project creation, but there's no PostHog instrumentation
to measure the rollout or understand how users respond to the new
behavior.

## Changes

**1. Flag state on project creation**
(`project_creation_simple_version_submitted`)

Adds `tableEditorApiAccessToggleEnabled` property — reads the raw
PostHog flag via `usePHFlag` rather than going through
`useDataApiGrantTogglesEnabled`, which coerces `undefined` (flag still
loading) to `false` and would silently poison the data. When the flag
hasn't loaded, the property is omitted from the event entirely.

**2. Per-table toggle tracking** (`table_api_access_toggle_clicked`)

New event that fires when a user flips the Data API access switch in the
table editor side panel (new tables only — existing tables link out to
settings). Tracks `newState: 'enabled' | 'disabled'` and `schemaName` so
we can distinguish public-schema toggles from custom schemas.

Together these let us answer: what % of projects have the new defaults,
and how do those users respond (do they opt tables back in, and in which
schemas)?

Part of the Secure by Default initiative (#43704)
2026-03-18 12:59:47 -07:00
..
2025-04-04 17:52:56 +00:00
2022-04-26 12:44:07 +02:00
2022-04-26 12:44:07 +02:00