telemetry-constants.ts 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464
  1. /**
  2. * Consolidated event definitions coming from the frontend, including studio, www, and docs.
  3. *
  4. * Note that events are not emitted for users that have opted out of telemetry.
  5. *
  6. * ## Naming conventions
  7. * Event names and actions should use standardized past-tense verbs for data quality and consistency.
  8. * Only use verbs already established in this file or in https://github.com/supabase/platform/blob/develop/shared/src/telemetry.ts
  9. * Adding new verbs requires @growth-eng review to prevent data pollution.
  10. *
  11. * @module telemetry-frontend
  12. */
  13. export type TelemetryGroups = {
  14. project: string
  15. organization: string
  16. }
  17. export const TABLE_EVENT_ACTIONS = {
  18. TableCreated: 'table_created',
  19. TableDataAdded: 'table_data_added',
  20. TableRLSEnabled: 'table_rls_enabled',
  21. } as const satisfies {
  22. TableCreated: TableCreatedEvent['action']
  23. TableDataAdded: TableDataAddedEvent['action']
  24. TableRLSEnabled: TableRLSEnabledEvent['action']
  25. }
  26. export type TableEventAction = (typeof TABLE_EVENT_ACTIONS)[keyof typeof TABLE_EVENT_ACTIONS]
  27. export const TABLE_EVENT_VALUES: TableEventAction[] = Object.values(TABLE_EVENT_ACTIONS)
  28. /**
  29. * Triggered when a user signs up. When signing up with Email and Password, this is only triggered once user confirms their email.
  30. *
  31. * @group Events
  32. * @source studio
  33. * @page /sign-up
  34. */
  35. export interface SignUpEvent {
  36. action: 'sign_up'
  37. properties: {
  38. category: 'conversion'
  39. }
  40. }
  41. /**
  42. * Triggered when a user signs in with GitHub, Email and Password or SSO.
  43. *
  44. * Some unintuitive behavior:
  45. * - If signing up with GitHub the SignInEvent gets triggered first before the SignUpEvent.
  46. *
  47. * @group Events
  48. * @source studio
  49. * @page /sign-in-mfa
  50. */
  51. export interface SignInEvent {
  52. action: 'sign_in'
  53. properties: {
  54. category: 'account'
  55. /**
  56. * The method used to sign in, e.g. email, github, sso
  57. */
  58. method: string
  59. }
  60. }
  61. /**
  62. * User copied the database connection string.
  63. *
  64. * @group Events
  65. * @source studio
  66. */
  67. export interface ConnectionStringCopiedEvent {
  68. action: 'connection_string_copied'
  69. properties: {
  70. /**
  71. * Method selected by user, e.g. URI, PSQL, SQLAlchemy, MCP URL, Framework snippet, Command Line, JSON, etc.
  72. * Required for Connection String, App Frameworks, and Mobile Frameworks tabs
  73. */
  74. connectionType?: string
  75. /**
  76. * Language of the code block if selected, e.g. bash, go, http, typescript
  77. * Required for Connection String, App Frameworks, and Mobile Frameworks tabs
  78. */
  79. lang?: string
  80. /**
  81. * Connection Method, e.g. direct, transaction_pooler, session_pooler
  82. * Only used for Connection String tab
  83. */
  84. connectionMethod?: 'direct' | 'transaction_pooler' | 'session_pooler'
  85. /**
  86. * Tab from which the connection string was copied
  87. */
  88. connectionTab: 'Connection String' | 'App Frameworks' | 'Mobile Frameworks' | 'ORMs' | 'MCP'
  89. /**
  90. * Selected framework, tool, or client (e.g., 'Next.js', 'Prisma', 'Cursor')
  91. */
  92. selectedItem?: string
  93. /**
  94. * Source of the event, either 'studio' or 'docs'
  95. */
  96. source?: 'studio' | 'docs'
  97. }
  98. groups: TelemetryGroups
  99. }
  100. /**
  101. * User clicked the MCP install button (one-click installation for Cursor or VS Code).
  102. *
  103. * @group Events
  104. * @source studio, docs
  105. */
  106. export interface McpInstallButtonClickedEvent {
  107. action: 'mcp_install_button_clicked'
  108. properties: {
  109. /**
  110. * The MCP client that was selected (e.g., 'Cursor', 'VS Code')
  111. */
  112. client: string
  113. /**
  114. * Source of the event, either 'studio' or 'docs'
  115. */
  116. source?: 'studio' | 'docs'
  117. }
  118. groups: TelemetryGroups
  119. }
  120. /**
  121. * Cron job created.
  122. *
  123. * @group Events
  124. * @source studio
  125. * @page /dashboard/project/{ref}/integrations/cron/jobs?new=true
  126. */
  127. export interface CronJobCreatedEvent {
  128. action: 'cron_job_created'
  129. properties: {
  130. /**
  131. * What the cron job executes, e.g. sql_function or sql_snippet
  132. */
  133. type: 'sql_function' | 'sql_snippet' | 'edge_function' | 'http_request'
  134. /**
  135. * Schedule of the cron job in the format of * * * * *
  136. */
  137. schedule: string
  138. }
  139. groups: TelemetryGroups
  140. }
  141. /**
  142. * Cron job updated.
  143. *
  144. * @group Events
  145. * @source studio
  146. * @page /dashboard/project/{ref}/integrations/cron/jobs?new=true
  147. */
  148. export interface CronJobUpdatedEvent {
  149. action: 'cron_job_updated'
  150. properties: {
  151. /**
  152. * What the cron job executes, e.g. sql_function or sql_snippet
  153. */
  154. type: 'sql_function' | 'sql_snippet' | 'edge_function' | 'http_request'
  155. /**
  156. * Schedule of the cron job in the format of * * * * *
  157. */
  158. schedule: string
  159. }
  160. groups: TelemetryGroups
  161. }
  162. /**
  163. * Cron job removed. Previously: cron_job_deleted
  164. *
  165. * @group Events
  166. * @source studio
  167. * @page /dashboard/project/{ref}/integrations/cron/jobs
  168. */
  169. export interface CronJobRemovedEvent {
  170. action: 'cron_job_removed'
  171. properties: {
  172. /** Cron job classification, parsed from the job's command at deletion time. */
  173. type: 'sql_function' | 'sql_snippet' | 'edge_function' | 'http_request'
  174. }
  175. groups: TelemetryGroups
  176. }
  177. /**
  178. * Create job button clicked that opens the dialog.
  179. *
  180. * @group Events
  181. * @source studio
  182. * @page /dashboard/project/{ref}/integrations/cron/jobs
  183. */
  184. export interface CronJobCreateClickedEvent {
  185. action: 'cron_job_create_clicked'
  186. groups: TelemetryGroups
  187. }
  188. /**
  189. * Edit cron job button (hidden in the dropdown) clicked that opens the dialog.
  190. *
  191. * @group Events
  192. * @source studio
  193. * @page /dashboard/project/{ref}/integrations/cron/jobs
  194. */
  195. export interface CronJobUpdateClickedEvent {
  196. action: 'cron_job_update_clicked'
  197. groups: TelemetryGroups
  198. }
  199. /**
  200. * Delete cron job button (hidden in the dropdown) clicked that opens the deletion confirmation modal.
  201. *
  202. * @group Events
  203. * @source studio
  204. * @page /dashboard/project/{ref}/integrations/cron/jobs
  205. */
  206. export interface CronJobDeleteClickedEvent {
  207. action: 'cron_job_delete_clicked'
  208. groups: TelemetryGroups
  209. }
  210. /**
  211. * User clicked the history button to see previous runs of the cron job
  212. *
  213. * @group Events
  214. * @source studio
  215. * @page /dashboard/project/{ref}/integrations/cron/jobs
  216. */
  217. export interface CronJobHistoryClickedEvent {
  218. action: 'cron_job_history_clicked'
  219. groups: TelemetryGroups
  220. }
  221. /**
  222. * A feature preview was enabled by the user through the FeaturePreviewModal.
  223. *
  224. * The FeaturePreviewModal can be opened clicking at the profile icon at the bottom left corner of the project sidebar.
  225. *
  226. * @group Events
  227. * @source studio
  228. */
  229. export interface FeaturePreviewEnabledEvent {
  230. action: 'feature_preview_enabled'
  231. properties: {
  232. /**
  233. * Feature key of the preview that was enabled. e.g. briven-ui-api-side-panel
  234. */
  235. feature: string
  236. }
  237. groups: TelemetryGroups
  238. }
  239. /**
  240. * A feature preview was disabled by the user through the FeaturePreviewModal.
  241. *
  242. * The FeaturePreviewModal can be opened clicking at the profile icon at the bottom left corner of the project sidebar.
  243. *
  244. * @group Events
  245. * @source studio
  246. */
  247. export interface FeaturePreviewDisabledEvent {
  248. action: 'feature_preview_disabled'
  249. properties: {
  250. /**
  251. * Feature key of the preview that was disabled. e.g. briven-ui-api-side-panel
  252. */
  253. feature: string
  254. }
  255. groups: TelemetryGroups
  256. }
  257. /**
  258. * The user picked a timezone in the dashboard timezone picker (in the user
  259. * avatar dropdown). Setting an explicit IANA value or returning to the auto
  260. * detected default both fire this event.
  261. *
  262. * @group Events
  263. * @source studio
  264. */
  265. export interface TimezonePickerClickedEvent {
  266. action: 'timezone_picker_clicked'
  267. properties: {
  268. /** IANA name resolved before the change. */
  269. previousTimezone: string
  270. /** IANA name resolved after the change. */
  271. nextTimezone: string
  272. /** True when the user opted back into the browser-detected default. */
  273. isAutoDetected: boolean
  274. /** Where the picker was rendered. */
  275. source: 'user_dropdown' | 'account_preferences'
  276. }
  277. groups: TelemetryGroups
  278. }
  279. /**
  280. * Top-of-funnel event for the dataApiRevokeOnCreateDefault rollout. Fires once per
  281. * mount after the flag resolves so cohort attribution is clean — pair with
  282. * project_creation_simple_version_submitted to measure the flag's impact on
  283. * project creation completion rate.
  284. *
  285. * @group Events
  286. * @source studio
  287. * @page new/{slug} and /integrations/vercel/{slug}/deploy-button/new-project
  288. */
  289. export interface ProjectCreationDefaultPrivilegesExposedEvent {
  290. action: 'project_creation_default_privileges_exposed'
  291. properties: {
  292. /** Where the checkbox was shown. */
  293. surface: 'main' | 'vercel'
  294. /**
  295. * Current state of the "Automatically expose new tables" checkbox
  296. * (`dataApiDefaultPrivileges` form field) at exposure time. This is the
  297. * field the experiment actually controls.
  298. * true = default privileges granted (legacy behaviour)
  299. * false = revoke SQL runs on create (new behaviour, treatment default)
  300. */
  301. dataApiDefaultPrivileges: boolean
  302. /**
  303. * Raw value of the dataApiRevokeOnCreateDefault PostHog flag at exposure time.
  304. * true = revoke cohort (checkbox defaulted to unchecked)
  305. * false = control cohort (checkbox defaulted to checked)
  306. */
  307. dataApiRevokeOnCreateDefaultEnabled: boolean
  308. }
  309. groups: Omit<TelemetryGroups, 'project'>
  310. }
  311. /**
  312. * Project creation form was submitted and the project was created. Fires from both
  313. * the main project creation wizard and the Vercel deploy-button flow — disambiguate
  314. * by the `surface` property.
  315. *
  316. * @group Events
  317. * @source studio
  318. * @page new/{slug} and /integrations/vercel/{slug}/deploy-button/new-project
  319. */
  320. export interface ProjectCreationSimpleVersionSubmittedEvent {
  321. action: 'project_creation_simple_version_submitted'
  322. properties: {
  323. /**
  324. * Which surface produced the submission. Omitted on events emitted before this
  325. * property was introduced; treat absent as 'main' for backfill.
  326. */
  327. surface?: 'main' | 'vercel'
  328. /**
  329. * The instance size selected in the project creation form.
  330. */
  331. instanceSize?: string
  332. /**
  333. * Whether the automatic RLS event trigger option was enabled
  334. */
  335. enableRlsEventTrigger?: boolean
  336. /**
  337. * Experiment variant: 'control' (checkbox not shown) or 'test' (checkbox shown)
  338. */
  339. rlsOptionVariant?: 'control' | 'test'
  340. /**
  341. * Whether Data API is enabled.
  342. * true = "Data API + Connection String" (default)
  343. * false = "Only Connection String"
  344. */
  345. dataApiEnabled?: boolean
  346. /**
  347. * Data API schema configuration. Only relevant when dataApiEnabled is true.
  348. * true = "Use dedicated API schema for Data API"
  349. * false = "Use public schema for Data API" (default)
  350. */
  351. useApiSchema?: boolean
  352. /**
  353. * Postgres engine type selection.
  354. * true = "Postgres with OrioleDB" (alpha)
  355. * false = "Postgres" (default)
  356. */
  357. useOrioleDb?: boolean
  358. /**
  359. * Raw checkbox state for "Automatically expose new tables and functions" at submission.
  360. * true = default privileges are granted on new entities (current behaviour)
  361. * false = revoke SQL ran; user must manually grant access per entity
  362. */
  363. dataApiDefaultPrivilegesGranted?: boolean
  364. /**
  365. * Whether the dataApiRevokeOnCreateDefault PostHog flag was enabled for this user.
  366. * Controls only the default checkbox state of "Automatically expose new tables and functions"
  367. * at project creation. Tracking it lets us correlate flag cohort with user choice.
  368. * true = user is in the staged rollout cohort (checkbox defaulted to unchecked)
  369. * false = user is outside the rollout (checkbox defaulted to checked)
  370. * omitted = PostHog flags had not loaded at the time of project creation
  371. */
  372. dataApiRevokeOnCreateDefaultEnabled?: boolean
  373. }
  374. groups: TelemetryGroups
  375. }
  376. /**
  377. * User clicked to connect GitHub during project creation.
  378. *
  379. * @group Events
  380. * @source studio
  381. * @page new/{slug}
  382. */
  383. export interface ProjectCreationGithubConnectClickedEvent {
  384. action: 'project_creation_github_connect_clicked'
  385. groups: Omit<TelemetryGroups, 'project'>
  386. }
  387. /**
  388. * Existing project creation form confirm modal was triggered and opened.
  389. *
  390. * @group Events
  391. * @source studio
  392. * @page new/{slug}
  393. */
  394. export interface ProjectCreationSimpleVersionConfirmModalOpenedEvent {
  395. action: 'project_creation_simple_version_confirm_modal_opened'
  396. /**
  397. * the instance size selected in the project creation form
  398. */
  399. properties: {
  400. instanceSize?: string
  401. }
  402. groups: Omit<TelemetryGroups, 'project'>
  403. }
  404. /**
  405. * User toggled Data API access on a table via the switch in the table editor side panel.
  406. * Only fires for new tables — editing existing tables links out to the settings page instead.
  407. *
  408. * @group Events
  409. * @source studio
  410. * @page /dashboard/project/{ref}/editor
  411. */
  412. export interface TableApiAccessToggleClickedEvent {
  413. action: 'table_api_access_toggle_clicked'
  414. properties: {
  415. /**
  416. * The resulting state of the toggle after the click.
  417. */
  418. newState: 'enabled' | 'disabled'
  419. /**
  420. * The schema containing the table being created.
  421. */
  422. schemaName: string
  423. }
  424. groups: TelemetryGroups
  425. }
  426. /**
  427. * User clicked either "Listening to channel" or "Start listening" button after selecting a channel.
  428. *
  429. * @group Events
  430. * @source studio
  431. * @page /dashboard/project/{ref}/realtime/inspector
  432. */
  433. export interface RealtimeInspectorListenChannelClickedEvent {
  434. action: 'realtime_inspector_listen_channel_clicked'
  435. groups: TelemetryGroups
  436. }
  437. /**
  438. * A broadcast message was sent from the SendMessageModal.
  439. *
  440. * @group Events
  441. * @source studio
  442. * @page /dashboard/project/{ref}/realtime/inspector
  443. */
  444. export interface RealtimeInspectorBroadcastSentEvent {
  445. action: 'realtime_inspector_broadcast_sent'
  446. groups: TelemetryGroups
  447. }
  448. /**
  449. * User clicked a message in the RealtimeInspector, which opens a sidebar that shows the messsage details including metadata.
  450. *
  451. * @group Events
  452. * @source studio
  453. * @page /dashboard/project/{ref}/realtime/inspector
  454. */
  455. export interface RealtimeInspectorMessageClickedEvent {
  456. action: 'realtime_inspector_message_clicked'
  457. groups: TelemetryGroups
  458. }
  459. /**
  460. * A message was copied from the RealtimeInspector.
  461. *
  462. * @group Events
  463. * @source studio
  464. * @page /dashboard/project/{ref}/realtime/inspector
  465. */
  466. export interface RealtimeInspectorCopyMessageClickedEvent {
  467. action: 'realtime_inspector_copy_message_clicked'
  468. groups: TelemetryGroups
  469. }
  470. /**
  471. * Filters were applied in the RealtimeInspector.
  472. *
  473. * @group Events
  474. * @source studio
  475. * @page /dashboard/project/{ref}/realtime/inspector
  476. */
  477. export interface RealtimeInspectorFiltersAppliedEvent {
  478. action: 'realtime_inspector_filters_applied'
  479. groups: TelemetryGroups
  480. }
  481. /**
  482. * Database role was updated in the RealtimeInspector.
  483. *
  484. * @group Events
  485. * @source studio
  486. * @page /dashboard/project/{ref}/realtime/inspector
  487. */
  488. export interface RealtimeInspectorDatabaseRoleUpdatedEvent {
  489. action: 'realtime_inspector_database_role_updated'
  490. groups: TelemetryGroups
  491. }
  492. /**
  493. * User clicked to toggle realtime on a table.
  494. *
  495. * @group Events
  496. * @source studio
  497. * @page /dashboard/project/{ref}/editor
  498. */
  499. export interface RealtimeToggleTableClickedEvent {
  500. action: 'realtime_toggle_table_clicked'
  501. properties: {
  502. /**
  503. * The state of the toggle.
  504. */
  505. newState: 'enabled' | 'disabled'
  506. /**
  507. * Where the toggle was clicked from
  508. */
  509. origin: 'tableSidePanel' | 'tableGridHeader'
  510. }
  511. groups: TelemetryGroups
  512. }
  513. /**
  514. * Realtime was enabled on a table.
  515. *
  516. * @group Events
  517. * @source studio
  518. * @page /dashboard/project/{ref}/editor
  519. */
  520. export interface TableRealtimeEnabledEvent {
  521. action: 'table_realtime_enabled'
  522. properties: {
  523. /**
  524. * The method used to enable realtime
  525. */
  526. method: 'ui' | 'sql_editor' | 'api'
  527. /**
  528. * Schema name
  529. */
  530. schema_name: string
  531. /**
  532. * Table name
  533. */
  534. table_name: string
  535. }
  536. groups: TelemetryGroups
  537. }
  538. /**
  539. * Realtime was disabled on a table.
  540. *
  541. * @group Events
  542. * @source studio
  543. * @page /dashboard/project/{ref}/editor
  544. */
  545. export interface TableRealtimeDisabledEvent {
  546. action: 'table_realtime_disabled'
  547. properties: {
  548. /**
  549. * The method used to disable realtime
  550. */
  551. method: 'ui' | 'sql_editor' | 'api'
  552. /**
  553. * Schema name
  554. */
  555. schema_name: string
  556. /**
  557. * Table name
  558. */
  559. table_name: string
  560. }
  561. groups: TelemetryGroups
  562. }
  563. /**
  564. * User clicked the quickstart card in the SQL editor.
  565. *
  566. * @group Events
  567. * @source studio
  568. * @page /dashboard/project/{ref}/sql
  569. */
  570. export interface SqlEditorQuickstartClickedEvent {
  571. action: 'sql_editor_quickstart_clicked'
  572. properties: {
  573. /**
  574. * The title of the quickstart card clicked.
  575. */
  576. quickstartName: string
  577. }
  578. groups: TelemetryGroups
  579. }
  580. /**
  581. * User clicked the template card in the SQL editor.
  582. *
  583. * @group Events
  584. * @source studio
  585. * @page /dashboard/project/{ref}/sql
  586. */
  587. export interface SqlEditorTemplateClickedEvent {
  588. action: 'sql_editor_template_clicked'
  589. properties: {
  590. /**
  591. * The name of the template card clicked.
  592. */
  593. templateName: string
  594. }
  595. groups: TelemetryGroups
  596. }
  597. /**
  598. * User clicked the "Result download CSV" button in the SQL editor.
  599. *
  600. * @group Events
  601. * @source studio
  602. * @page /dashboard/project/{ref}/sql
  603. */
  604. export interface SqlEditorResultDownloadCsvClickedEvent {
  605. action: 'sql_editor_result_download_csv_clicked'
  606. groups: TelemetryGroups
  607. }
  608. /**
  609. * User clicked the "Result copy Markdown" button in the SQL editor.
  610. *
  611. * @group Events
  612. * @source studio
  613. * @page /dashboard/project/{ref}/sql
  614. */
  615. export interface SqlEditorResultCopyMarkdownClickedEvent {
  616. action: 'sql_editor_result_copy_markdown_clicked'
  617. groups: TelemetryGroups
  618. }
  619. /**
  620. * User clicked the "Result copy JSON" button in the SQL editor
  621. *
  622. * @group Events
  623. * @source studio
  624. * @page /dashboard/project/{ref}/sql
  625. */
  626. export interface SqlEditorResultCopyJsonClickedEvent {
  627. action: 'sql_editor_result_copy_json_clicked'
  628. groups: TelemetryGroups
  629. }
  630. /**
  631. * User clicked the "Result copy CSV" button in the SQL editor
  632. *
  633. * @group Events
  634. * @source studio
  635. * @page /dashboard/project/{ref}/sql
  636. */
  637. export interface SqlEditorResultCopyCsvClickedEvent {
  638. action: 'sql_editor_result_copy_csv_clicked'
  639. groups: TelemetryGroups
  640. }
  641. /**
  642. * User submitted a prompt to the assistant sidebar.
  643. *
  644. * @group Events
  645. * @source studio
  646. */
  647. export interface AssistantPromptSubmittedEvent {
  648. action: 'assistant_prompt_submitted'
  649. properties: {
  650. /** UUID of the chat session in which the prompt was submitted */
  651. chatId?: string
  652. }
  653. groups: TelemetryGroups
  654. }
  655. /**
  656. * User submitted a debug request to the assistant sidebar or prompt submitted has Help me to debug.
  657. *
  658. * @group Events
  659. * @source studio
  660. */
  661. export interface AssistantDebugSubmittedEvent {
  662. action: 'assistant_debug_submitted'
  663. properties: {
  664. /** UUID of the chat session in which the debug request was submitted */
  665. chatId?: string
  666. }
  667. groups: TelemetryGroups
  668. }
  669. /**
  670. * User clicked the run query button in the suggestion provided in the assistant sidebar.
  671. *
  672. * @group Events
  673. * @source studio
  674. */
  675. export interface AssistantSuggestionRunQueryClickedEvent {
  676. action: 'assistant_suggestion_run_query_clicked'
  677. properties: {
  678. /**
  679. * The type of suggestion that was run by the user. Mutate or Select query types only.
  680. */
  681. queryType: string
  682. /**
  683. * For mutation queries only: the DDL subtype detected from the SQL.
  684. * 'functions' for CREATE FUNCTION / CREATE OR REPLACE FUNCTION,
  685. * 'rls-policies' for CREATE POLICY / ALTER POLICY,
  686. * 'unknown' for any other mutation. Omitted for non-mutation queries.
  687. */
  688. mutationType?: 'functions' | 'rls-policies' | 'unknown'
  689. }
  690. groups: TelemetryGroups
  691. }
  692. /**
  693. * User accepted or rejected changes in sql ai diff handler.
  694. * They can accept change by clicking accept button or typing shortcut (CMD+Enter) or reject by clicking reject button or typing shortcut (Esc).
  695. * Handler only appears after clicking any dropdown option in Edit in Sql Editor in suggestion provided by the assistant.
  696. * The dropdown options only appear in any page with 'sql' in url.
  697. *
  698. * @group Events
  699. * @source studio
  700. * @page /dashboard/project/{ref}/sql
  701. */
  702. export interface AssistantSqlDiffHandlerEvaluatedEvent {
  703. action: 'assistant_sql_diff_handler_evaluated'
  704. properties: {
  705. /**
  706. * Whether the user accepted or rejected the changes.
  707. */
  708. handlerAccepted: boolean
  709. }
  710. groups: TelemetryGroups
  711. }
  712. /**
  713. * User clicked Edit in SQL Editor button in the assistant sidebar when user is in any page that does not have 'sql' in url or is in a new snippet.
  714. *
  715. * @group Events
  716. * @source studio
  717. */
  718. export interface AssistantEditInSqlEditorClickedEvent {
  719. action: 'assistant_edit_in_sql_editor_clicked'
  720. properties: {
  721. /**
  722. * Whether the user is in the SQL editor page or in a new snippet.
  723. */
  724. isInSQLEditor: boolean
  725. isInNewSnippet: boolean
  726. }
  727. groups: TelemetryGroups
  728. }
  729. /**
  730. * User clicked on Add block -> SQL Snippets -> a SQL snippet in a custom reports page.
  731. *
  732. * @group Events
  733. * @source studio
  734. * @page /dashboard/project/{ref}/reports/{id}
  735. */
  736. export interface CustomReportAddSQLBlockClickedEvent {
  737. action: 'custom_report_add_sql_block_clicked'
  738. groups: TelemetryGroups
  739. }
  740. /**
  741. * User dragged and dropped a SQL block from the Assistant Panel into the custom report while on a custom report page.
  742. *
  743. * @group Events
  744. * @source studio
  745. * @page /dashboard/project/{ref}/reports/{id}
  746. */
  747. export interface CustomReportAssistantSQLBlockAddedEvent {
  748. action: 'custom_report_assistant_sql_block_added'
  749. groups: TelemetryGroups
  750. }
  751. /**
  752. * User voted on the feedback button on a docs page. The feedback button is located at the sidebar of every docs page.
  753. *
  754. * @group Events
  755. * @source docs
  756. */
  757. export interface DocsFeedbackClickedEvent {
  758. action: 'docs_feedback_clicked'
  759. properties: {
  760. /**
  761. * 'yes' means clicking on the tick button, 'no' means clicking on the cross button.
  762. */
  763. response: 'yes' | 'no'
  764. }
  765. }
  766. /**
  767. * User clicked 'Copy as Markdown' option on a page.
  768. *
  769. * @group Events
  770. * @source docs
  771. */
  772. export interface CopyAsMarkdownEvent {
  773. action: 'copy_as_markdown_clicked'
  774. }
  775. /**
  776. * User clicked "Ask..." to open a new window to consult an agent about the current page.
  777. *
  778. * @group Events
  779. * @source docs
  780. */
  781. export interface AskAIEvent {
  782. action: 'ask_ai_clicked'
  783. properties: {
  784. agent: 'chatgpt' | 'claude'
  785. }
  786. }
  787. /**
  788. * User clicked the framework quickstart card on the homepage, leading to the specific framework documentation.
  789. *
  790. * @group Events
  791. * @source www
  792. * @page /
  793. */
  794. export interface HomepageFrameworkQuickstartClickedEvent {
  795. action: 'homepage_framework_quickstart_clicked'
  796. properties: {
  797. /**
  798. * The name of the framework quickstart card clicked.
  799. */
  800. frameworkName: string
  801. }
  802. }
  803. /**
  804. * User clicked on a product card in the homepage products section.
  805. *
  806. * @group Events
  807. * @source www
  808. * @page /
  809. */
  810. export interface HomepageProductCardClickedEvent {
  811. action: 'homepage_product_card_clicked'
  812. properties: {
  813. product: string
  814. }
  815. }
  816. /**
  817. * User clicked on the CTA button on a plan in the pricing page.
  818. *
  819. * @group Events
  820. * @source www
  821. * @page /pricing
  822. */
  823. export interface WwwPricingPlanCtaClickedEvent {
  824. action: 'www_pricing_plan_cta_clicked'
  825. properties: {
  826. /**
  827. * The plan type that was clicked.
  828. */
  829. plan: string
  830. /**
  831. * Whether the upgrade now text is shown on the cta button. This is only shown when org is upgradeable and user is logged in.
  832. */
  833. showUpgradeText: boolean
  834. /**
  835. * The section of the page where the plan was clicked.
  836. * Main means the big top section of the page,
  837. * comparison_table means the comparison table with all plans listed together below.
  838. */
  839. section: 'main' | 'comparison_table'
  840. tableMode?: 'mobile' | 'desktop'
  841. }
  842. groups?: Partial<TelemetryGroups>
  843. }
  844. /**
  845. * User clicked the main CTA button in an event page.
  846. *
  847. * @group Events
  848. * @source www
  849. * @page /events/*
  850. */
  851. export interface EventPageCtaClickedEvent {
  852. action: 'www_event_page_cta_clicked'
  853. properties: {
  854. /**
  855. * The title of the event clicked.
  856. */
  857. eventTitle: string
  858. }
  859. }
  860. /**
  861. * User clicked the GitHub button in the homepage header section. The button is hidden in mobile view.
  862. *
  863. * @group Events
  864. * @source www
  865. * @page /
  866. */
  867. export interface HomepageGitHubButtonClickedEvent {
  868. action: 'homepage_github_button_clicked'
  869. }
  870. /**
  871. * User clicked the Discord button in the homepage community section.
  872. *
  873. * @group Events
  874. * @source www
  875. * @page /
  876. */
  877. export interface HomepageDiscordButtonClickedEvent {
  878. action: 'homepage_discord_button_clicked'
  879. }
  880. /**
  881. * User clicked a customer story card in the homepage.
  882. *
  883. * @group Events
  884. * @source www
  885. * @page /
  886. */
  887. export interface HomepageCustomerStoryCardClickedEvent {
  888. action: 'homepage_customer_story_card_clicked'
  889. properties: {
  890. customer?: string
  891. /**
  892. * The size of the card clicked.
  893. */
  894. cardType: 'expanded' | 'narrow'
  895. }
  896. }
  897. /**
  898. * User clicked the project template card in the homepage.
  899. *
  900. * @group Events
  901. * @source www
  902. * @page /
  903. */
  904. export interface HomepageProjectTemplateCardClickedEvent {
  905. action: 'homepage_project_template_card_clicked'
  906. properties: {
  907. /**
  908. * The title of the project template card clicked.
  909. */
  910. templateTitle: string
  911. }
  912. }
  913. /**
  914. * User clicked the open source repository card.
  915. *
  916. * @group Events
  917. * @source www
  918. * @page /open-source
  919. */
  920. export interface OpenSourceRepoCardClickedEvent {
  921. action: 'open_source_repo_card_clicked'
  922. properties: {
  923. /**
  924. * The name of the open source repository clicked.
  925. */
  926. repoName: string
  927. }
  928. }
  929. /**
  930. * User clicked the green "Start Project" button in various locations described in properties.
  931. *
  932. * @group Events
  933. * @source www
  934. */
  935. export interface StartProjectButtonClickedEvent {
  936. action: 'start_project_button_clicked'
  937. properties: {
  938. /**
  939. * The source of the button click, e.g. homepage hero, product page header.
  940. */
  941. buttonLocation: string
  942. }
  943. }
  944. /**
  945. * User clicked the "See Documentation" button usually next to the "Start Project" button in various locations described in properties.
  946. *
  947. * @group Events
  948. * @source www
  949. */
  950. export interface SeeDocumentationButtonClickedEvent {
  951. action: 'see_documentation_button_clicked'
  952. properties: {
  953. /**
  954. * The source of the button click, e.g. homepage hero, product page header - product name.
  955. */
  956. buttonLocation: string
  957. }
  958. }
  959. /**
  960. * User clicked the "Request a Demo" button in various locations described in properties.
  961. *
  962. * @group Events
  963. * @source www
  964. */
  965. export interface RequestDemoButtonClickedEvent {
  966. action: 'request_demo_button_clicked'
  967. properties: {
  968. /**
  969. * The source of the button click, e.g. homepage hero, cta banner, product page header.
  970. * If it states it came from the request demo form, it can come from different pages so refer to path name to determine.
  971. */
  972. buttonLocation: string
  973. }
  974. }
  975. /**
  976. * User clicked the sign-in button in various locations described in properties.
  977. *
  978. * @group Events
  979. * @source www
  980. */
  981. export interface SignInButtonClickedEvent {
  982. action: 'sign_in_button_clicked'
  983. properties: {
  984. /**
  985. * The source of the button click, e.g. homepage hero, cta banner, product page header.
  986. */
  987. buttonLocation: string
  988. }
  989. }
  990. /**
  991. * User clicked the "Help" button in the top right corner of the page header.
  992. *
  993. * @group Events
  994. * @source studio
  995. */
  996. export interface HelpButtonClickedEvent {
  997. action: 'help_button_clicked'
  998. groups: Partial<TelemetryGroups>
  999. }
  1000. /**
  1001. * User clicked the "Send Feedback" button in the top right corner of the page header.
  1002. *
  1003. * @group Events
  1004. * @source studio
  1005. */
  1006. export interface SendFeedbackButtonClickedEvent {
  1007. action: 'send_feedback_button_clicked'
  1008. groups: Partial<TelemetryGroups>
  1009. }
  1010. /**
  1011. * User clicked on an example project card.
  1012. *
  1013. * @group Events
  1014. * @source studio
  1015. * @page /project/{ref}
  1016. */
  1017. export interface ExampleProjectCardClickedEvent {
  1018. action: 'example_project_card_clicked'
  1019. properties: {
  1020. /**
  1021. * The title of the example project card clicked.
  1022. */
  1023. cardTitle: string
  1024. }
  1025. groups: TelemetryGroups
  1026. }
  1027. /**
  1028. * User clicked the "Import Data" button.
  1029. *
  1030. * @group Events
  1031. * @source studio
  1032. * @page /dashboard/project/{ref}/editor
  1033. */
  1034. export interface ImportDataButtonClickedEvent {
  1035. action: 'import_data_button_clicked'
  1036. properties: {
  1037. /**
  1038. * The type of table the data is imported to.
  1039. * New Table means added when creating new table by clicking from New table sidebar,
  1040. * Existing Table means added to an existing table by going to the table and clicking from the green Insert button..
  1041. */
  1042. tableType: 'New Table' | 'Existing Table'
  1043. }
  1044. groups: TelemetryGroups
  1045. }
  1046. /**
  1047. * User added a file to the import data dropzone on an empty table.
  1048. *
  1049. * @group Events
  1050. * @source studio
  1051. * @page /dashboard/project/{ref}/editor
  1052. */
  1053. export interface ImportDataFileAddedEvent {
  1054. action: 'import_data_dropzone_file_added'
  1055. groups: TelemetryGroups
  1056. }
  1057. /**
  1058. * User added data from the import data via CSV/spreadsheet successfully.
  1059. *
  1060. * @group Events
  1061. * @source studio
  1062. * @page /dashboard/project/{ref}/editor
  1063. */
  1064. export interface ImportDataAddedEvent {
  1065. action: 'import_data_added'
  1066. groups: TelemetryGroups
  1067. }
  1068. /**
  1069. * User clicked the run query button in the SQL editor.
  1070. *
  1071. * @group Events
  1072. * @source studio
  1073. * @page /dashboard/project/{ref}/sql/{id}
  1074. */
  1075. export interface SqlEditorQueryRunButtonClickedEvent {
  1076. action: 'sql_editor_query_run_button_clicked'
  1077. groups: TelemetryGroups
  1078. }
  1079. /**
  1080. * User clicked on the CTA button on a plan in the pricing side panel in studio.
  1081. *
  1082. * @group Events
  1083. * @source studio
  1084. * @page /billing?panel=subscriptionPlan
  1085. */
  1086. export interface StudioPricingPlanCtaClickedEvent {
  1087. action: 'studio_pricing_plan_cta_clicked'
  1088. properties: {
  1089. /**
  1090. * The plan type that was clicked.
  1091. */
  1092. selectedPlan: string
  1093. /**
  1094. * The plan type the org is currently on.
  1095. */
  1096. currentPlan?: string
  1097. }
  1098. groups: Omit<TelemetryGroups, 'project'>
  1099. }
  1100. /**
  1101. * User opened the pricing side panel in studio.
  1102. *
  1103. * @group Events
  1104. * @source studio
  1105. * @page /billing?panel=subscriptionPlan
  1106. */
  1107. export interface StudioPricingSidePanelOpenedEvent {
  1108. action: 'studio_pricing_side_panel_opened'
  1109. properties: {
  1110. currentPlan?: string
  1111. /**
  1112. * Tracks how user landed on the Pricing side panel, e.g. diskManagementPanelDiskSize, backupsRestoreToNewProject
  1113. */
  1114. origin?: string
  1115. }
  1116. groups: Omit<TelemetryGroups, 'project'>
  1117. }
  1118. /**
  1119. * User clicks on grafana banner in studio Reports page.
  1120. *
  1121. * @group Events
  1122. * @source studio
  1123. * @page /reports/database
  1124. */
  1125. export interface ReportsDatabaseGrafanaBannerClickedEvent {
  1126. action: 'reports_database_grafana_banner_clicked'
  1127. groups: TelemetryGroups
  1128. }
  1129. /**
  1130. * User clicks on Metrics API banner CTA button in studio Observability pages.
  1131. *
  1132. * @group Events
  1133. * @source studio
  1134. * @page /observability/*
  1135. */
  1136. export interface MetricsAPIBannerCtaButtonClickedEvent {
  1137. action: 'metrics_api_banner_cta_button_clicked'
  1138. groups: TelemetryGroups
  1139. }
  1140. /**
  1141. * User clicked the dismiss button on a banner in studio Observability pages.
  1142. *
  1143. * @group Events
  1144. * @source studio
  1145. * @page /observability/*
  1146. */
  1147. export interface MetricsAPIBannerDismissButtonClickedEvent {
  1148. action: 'metrics_api_banner_dismiss_button_clicked'
  1149. groups: TelemetryGroups
  1150. }
  1151. /**
  1152. * User clicked the enable button for Index Advisor, either from the banner or the confirmation dialog.
  1153. *
  1154. * @group Events
  1155. * @source studio
  1156. * @page /observability/query-performance
  1157. */
  1158. export interface IndexAdvisorEnableButtonClickedEvent {
  1159. action: 'index_advisor_enable_button_clicked'
  1160. properties: {
  1161. origin: 'banner' | 'dialog'
  1162. }
  1163. groups: TelemetryGroups
  1164. }
  1165. /**
  1166. * Index Advisor banner dimissed event.
  1167. *
  1168. * @group Events
  1169. * @source studio
  1170. * @page /observability/query-performance
  1171. */
  1172. export interface IndexAdvisorBannerDismissButtonClickedEvent {
  1173. action: 'index_advisor_banner_dismiss_button_clicked'
  1174. groups: TelemetryGroups
  1175. }
  1176. /**
  1177. * Index Advisor tab clicked event.
  1178. *
  1179. * @group Events
  1180. * @source studio
  1181. * @page /observability/query-performance
  1182. */
  1183. export interface IndexAdvisorTabClickedEvent {
  1184. action: 'index_advisor_tab_clicked'
  1185. properties: {
  1186. hasRecommendations: boolean
  1187. isIndexAdvisorEnabled: boolean
  1188. }
  1189. groups: TelemetryGroups
  1190. }
  1191. /**
  1192. * Index Advisor create indexes button clicked event.
  1193. *
  1194. * @group Events
  1195. * @source studio
  1196. * @page /observability/query-performance
  1197. */
  1198. export interface IndexAdvisorCreateIndexesButtonClickedEvent {
  1199. action: 'index_advisor_create_indexes_button_clicked'
  1200. groups: TelemetryGroups
  1201. }
  1202. /**
  1203. * User clicked the deploy button for an Edge Function.
  1204. *
  1205. * @group Events
  1206. * @source studio
  1207. * @page /dashboard/project/{ref}/functions/new
  1208. */
  1209. export interface EdgeFunctionDeployButtonClickedEvent {
  1210. action: 'edge_function_deploy_button_clicked'
  1211. properties: {
  1212. /**
  1213. * Click on Deploy can either happen:
  1214. * 1. in the functions editor page
  1215. * 2. in the chat button in the functions editor
  1216. */
  1217. origin: 'functions_editor' | 'functions_ai_assistant'
  1218. }
  1219. groups: TelemetryGroups
  1220. }
  1221. /**
  1222. * User clicked the confirm deploy updates button for an Edge Function in the code page within the warning model.
  1223. *
  1224. * @group Events
  1225. * @source studio
  1226. * @page /dashboard/project/{ref}/functions/{id}/code
  1227. */
  1228. export interface EdgeFunctionDeployUpdatesConfirmClickedEvent {
  1229. action: 'edge_function_deploy_updates_confirm_clicked'
  1230. groups: TelemetryGroups
  1231. }
  1232. /**
  1233. * User clicked the AI Assistant button to create an Edge Function.
  1234. *
  1235. * @group Events
  1236. * @source studio
  1237. * @page /dashboard/project/{ref}/functions
  1238. */
  1239. export interface EdgeFunctionAiAssistantButtonClickedEvent {
  1240. action: 'edge_function_ai_assistant_button_clicked'
  1241. properties: {
  1242. /**
  1243. * Click on AI Assistant can either happen:
  1244. * 1. on the main block when there are no functions
  1245. * 2. in the secondary action section of the page
  1246. * 3. on the chat button in the functions editor
  1247. */
  1248. origin: 'no_functions_block' | 'secondary_action' | 'functions_editor_chat'
  1249. }
  1250. groups: TelemetryGroups
  1251. }
  1252. /**
  1253. * User clicked the button to go to the functions editor page to create an edge function.
  1254. *
  1255. * @group Events
  1256. * @source studio
  1257. * @page /dashboard/project/{ref}/functions
  1258. */
  1259. export interface EdgeFunctionViaEditorButtonClickedEvent {
  1260. action: 'edge_function_via_editor_button_clicked'
  1261. properties: {
  1262. /**
  1263. * Click on Via Editor can either happen:
  1264. * 1. on the main block when there are no functions
  1265. * 2. in the secondary action section of the page
  1266. */
  1267. origin: 'no_functions_block' | 'secondary_action'
  1268. }
  1269. groups: TelemetryGroups
  1270. }
  1271. /**
  1272. * User clicked on an Edge Function template.
  1273. *
  1274. * @group Events
  1275. * @source studio
  1276. * @page /dashboard/project/{ref}/functions
  1277. */
  1278. export interface EdgeFunctionTemplateClickedEvent {
  1279. action: 'edge_function_template_clicked'
  1280. properties: {
  1281. templateName: string
  1282. /**
  1283. * Where the edge function template was clicked from:
  1284. * 1. functions page
  1285. * 2. editor page
  1286. */
  1287. origin: 'functions_page' | 'editor_page'
  1288. }
  1289. groups: TelemetryGroups
  1290. }
  1291. /**
  1292. * User clicked the button to create an edge function via CLI.
  1293. *
  1294. * @group Events
  1295. * @source studio
  1296. * @page /dashboard/project/{ref}/functions
  1297. */
  1298. export interface EdgeFunctionViaCliButtonClickedEvent {
  1299. action: 'edge_function_via_cli_button_clicked'
  1300. properties: {
  1301. /**
  1302. * Click on Via CLI can either happen:
  1303. * 1. on the main block when there are no functions
  1304. * 2. in the secondary action section of the page
  1305. */
  1306. origin: 'no_functions_block' | 'secondary_action'
  1307. }
  1308. groups: TelemetryGroups
  1309. }
  1310. /**
  1311. * User clicked the deploy updates button for an edge function.
  1312. *
  1313. * @group Events
  1314. * @source studio
  1315. * @page /dashboard/project/{ref}/functions/{id}/code
  1316. */
  1317. export interface EdgeFunctionDeployUpdatesButtonClickedEvent {
  1318. action: 'edge_function_deploy_updates_button_clicked'
  1319. groups: TelemetryGroups
  1320. }
  1321. /**
  1322. * User clicked the Send Request button for testing an Edge Function.
  1323. *
  1324. * @group Events
  1325. * @source studio
  1326. * @page /dashboard/project/{ref}/functions/{id}
  1327. */
  1328. export interface EdgeFunctionTestSendButtonClickedEvent {
  1329. action: 'edge_function_test_send_button_clicked'
  1330. properties: {
  1331. /**
  1332. * The HTTP method used for the test request, e.g., GET, POST.
  1333. */
  1334. httpMethod: string
  1335. }
  1336. groups: TelemetryGroups
  1337. }
  1338. /**
  1339. * User opened the side panel for testing an edge function.
  1340. *
  1341. * @group Events
  1342. * @source studio
  1343. * @page /dashboard/project/{ref}/functions/{id}
  1344. */
  1345. export interface EdgeFunctionTestSidePanelOpenedEvent {
  1346. action: 'edge_function_test_side_panel_opened'
  1347. groups: TelemetryGroups
  1348. }
  1349. /**
  1350. * User submitted a support ticket. Project and organization are optional because the ticket might be about user account issues.
  1351. *
  1352. * @group Events
  1353. * @source studio
  1354. * @page /dashboard/support/new
  1355. */
  1356. export interface SupportTicketSubmittedEvent {
  1357. action: 'support_ticket_submitted'
  1358. properties: {
  1359. ticketCategory: string
  1360. }
  1361. groups: Partial<TelemetryGroups>
  1362. }
  1363. /**
  1364. * User clicked the AI Assistant card on top of the support ticket form.
  1365. * This event is specifically when the user goes back to the AI Assistant in the Studio.
  1366. *
  1367. * @group Events
  1368. * @source studio
  1369. * @page /dashboard/support/new
  1370. */
  1371. export interface AiAssistantInSupportFormClickedEvent {
  1372. action: 'ai_assistant_in_support_form_clicked'
  1373. groups: Partial<TelemetryGroups>
  1374. }
  1375. /**
  1376. * User rated an AI assistant message with thumbs up or thumbs down.
  1377. *
  1378. * @group Events
  1379. * @source studio
  1380. */
  1381. export interface AssistantMessageRatingSubmittedEvent {
  1382. action: 'assistant_message_rating_submitted'
  1383. properties: {
  1384. /**
  1385. * The rating given by the user: positive (thumbs up) or negative (thumbs down)
  1386. */
  1387. rating: 'positive' | 'negative'
  1388. /**
  1389. * The category of the conversation
  1390. */
  1391. category:
  1392. | 'sql_generation'
  1393. | 'schema_design'
  1394. | 'rls_policies'
  1395. | 'edge_functions'
  1396. | 'database_optimization'
  1397. | 'debugging'
  1398. | 'general_help'
  1399. | 'other'
  1400. /** Optional reason provided by the user when rating negatively */
  1401. reason?: string
  1402. /** UUID of the chat session in which the message was rated */
  1403. chatId?: string
  1404. }
  1405. groups: TelemetryGroups
  1406. }
  1407. /**
  1408. * User copied the command for a Briven UI component.
  1409. *
  1410. * @group Events
  1411. * @source briven-ui
  1412. * @page /ui/docs/{framework}/{templateTitle}
  1413. */
  1414. export interface BrivenUiCommandCopyButtonClickedEvent {
  1415. action: 'briven_ui_command_copy_button_clicked'
  1416. properties: {
  1417. templateTitle: string
  1418. command: string
  1419. framework: 'nextjs' | 'react-router' | 'tanstack' | 'react' | 'vue' | 'nuxtjs'
  1420. packageManager: 'npm' | 'pnpm' | 'yarn' | 'bun'
  1421. }
  1422. }
  1423. /**
  1424. * Triggered when the organization MFA enforcement setting is updated.
  1425. *
  1426. * @group Events
  1427. * @source studio
  1428. * @page /dashboard/org/{slug}/security
  1429. */
  1430. export interface OrganizationMfaEnforcementUpdatedEvent {
  1431. action: 'organization_mfa_enforcement_updated'
  1432. properties: {
  1433. mfaEnforced: boolean
  1434. }
  1435. groups: Omit<TelemetryGroups, 'project'>
  1436. }
  1437. /**
  1438. * Triggered when a new foreign data wrapper is created in a project.
  1439. *
  1440. * @group Events
  1441. * @source studio
  1442. * @page /dashboard/project/{ref}/database/integrations
  1443. */
  1444. export interface ForeignDataWrapperCreatedEvent {
  1445. action: 'foreign_data_wrapper_created'
  1446. properties: {
  1447. /**
  1448. * The type of the foreign data wrapper, e.g. postgres_fdw, mysql_fdw, etc.
  1449. */
  1450. wrapperType: string
  1451. }
  1452. groups: TelemetryGroups
  1453. }
  1454. /**
  1455. * Triggered when a new storage bucket is created in a project.
  1456. *
  1457. * @group Events
  1458. * @source studio
  1459. * @page /dashboard/project/{ref}/storage/buckets
  1460. */
  1461. export interface StorageBucketCreatedEvent {
  1462. action: 'storage_bucket_created'
  1463. properties: {
  1464. /**
  1465. * The type of the bucket created. E.g. standard or analytics iceberg.
  1466. */
  1467. bucketType?: string
  1468. }
  1469. groups: TelemetryGroups
  1470. }
  1471. /**
  1472. * Triggered when a new branch is created.
  1473. *
  1474. * @group Events
  1475. * @source studio
  1476. * @page /dashboard/project/{ref}/branches
  1477. */
  1478. export interface BranchCreateButtonClickedEvent {
  1479. action: 'branch_create_button_clicked'
  1480. properties: {
  1481. /**
  1482. * The type of branch created, e.g. preview, persistent
  1483. */
  1484. branchType: 'preview' | 'persistent'
  1485. /**
  1486. * Whether the branch was created with a git branch association
  1487. */
  1488. gitlessBranching: boolean
  1489. }
  1490. groups: TelemetryGroups
  1491. }
  1492. /**
  1493. * Triggered when a branch delete button is clicked.
  1494. *
  1495. * @group Events
  1496. * @source studio
  1497. * @page /dashboard/project/{ref}/branches
  1498. */
  1499. export interface BranchDeleteButtonClickedEvent {
  1500. action: 'branch_delete_button_clicked'
  1501. properties: {
  1502. /**
  1503. * The type of branch being deleted, e.g. preview, persistent
  1504. */
  1505. branchType?: 'preview' | 'persistent'
  1506. /**
  1507. * Where the delete action was initiated from
  1508. */
  1509. origin: 'branches_page' | 'merge_page'
  1510. }
  1511. groups: TelemetryGroups
  1512. }
  1513. /**
  1514. * Triggered when a create merge request is clicked for a branch.
  1515. *
  1516. * @group Events
  1517. * @source studio
  1518. * @page /dashboard/project/{ref}/branches
  1519. */
  1520. export interface BranchCreateMergeRequestButtonClickedEvent {
  1521. action: 'branch_create_merge_request_button_clicked'
  1522. properties: {
  1523. /**
  1524. * The type of branch being merged, e.g. preview, persistent
  1525. */
  1526. branchType: 'preview' | 'persistent'
  1527. origin: 'header' | 'merge_page' | 'branch_selector'
  1528. }
  1529. groups: TelemetryGroups
  1530. }
  1531. /**
  1532. * Triggered when a merge request is closed.
  1533. *
  1534. * @group Events
  1535. * @source studio
  1536. * @page /dashboard/project/{ref}/branches/merge-requests
  1537. */
  1538. export interface BranchCloseMergeRequestButtonClickedEvent {
  1539. action: 'branch_close_merge_request_button_clicked'
  1540. groups: TelemetryGroups
  1541. }
  1542. /**
  1543. * Triggered when a user clicks the merge button successfully to attempt merging a branch.
  1544. *
  1545. * @group Events
  1546. * @source studio
  1547. * @page /dashboard/project/{ref}/merge
  1548. */
  1549. export interface BranchMergeSubmittedEvent {
  1550. action: 'branch_merge_submitted'
  1551. groups: TelemetryGroups
  1552. }
  1553. /**
  1554. * Triggered when a branch merge completes successfully. Previously: branch_merge_succeeded
  1555. *
  1556. * @group Events
  1557. * @source studio
  1558. * @page /dashboard/project/{ref}/merge
  1559. */
  1560. export interface BranchMergeCompletedEvent {
  1561. action: 'branch_merge_completed'
  1562. properties: {
  1563. /**
  1564. * The type of branch being merged, e.g. preview, persistent
  1565. */
  1566. branchType: 'preview' | 'persistent'
  1567. }
  1568. groups: TelemetryGroups
  1569. }
  1570. /**
  1571. * Triggered when a branch merge fails.
  1572. *
  1573. * @group Events
  1574. * @source studio
  1575. * @page /dashboard/project/{ref}/merge
  1576. */
  1577. export interface BranchMergeFailedEvent {
  1578. action: 'branch_merge_failed'
  1579. properties: {
  1580. /**
  1581. * The type of branch being merged, e.g. preview, persistent
  1582. */
  1583. branchType: 'preview' | 'persistent'
  1584. /**
  1585. * The error message or reason for failure
  1586. */
  1587. error?: string
  1588. }
  1589. groups: TelemetryGroups
  1590. }
  1591. /**
  1592. * Triggered when a branch is updated on push with latest changes from production.
  1593. * Does not include renaming and linking to GitHub branch.
  1594. *
  1595. * @group Events
  1596. * @source studio
  1597. * @page /dashboard/project/{ref}/merge
  1598. */
  1599. export interface BranchUpdatedEvent {
  1600. action: 'branch_updated'
  1601. properties: {
  1602. /**
  1603. * The source of the update action
  1604. */
  1605. source: 'merge_page' | 'out_of_date_notice'
  1606. modifiedEdgeFunctions?: boolean
  1607. }
  1608. groups: TelemetryGroups
  1609. }
  1610. /**
  1611. * Triggered when a user clicks the review with assistant button for a merge.
  1612. *
  1613. * @group Events
  1614. * @source studio
  1615. * @page /dashboard/project/{ref}/merge
  1616. */
  1617. export interface BranchReviewWithAssistantClickedEvent {
  1618. action: 'branch_review_with_assistant_clicked'
  1619. groups: TelemetryGroups
  1620. }
  1621. /**
  1622. * Triggered when a user selects a branch from the branch selector dropdown.
  1623. *
  1624. * @group Events
  1625. * @source studio
  1626. * @page branch selector (header / sheet / popover)
  1627. */
  1628. export interface BranchSelectorBranchClickedEvent {
  1629. action: 'branch_selector_branch_clicked'
  1630. properties: {
  1631. branchId: string
  1632. branchName: string
  1633. }
  1634. groups: TelemetryGroups
  1635. }
  1636. /**
  1637. * Triggered when a user clicks "Create branch" in the branch selector dropdown.
  1638. *
  1639. * @group Events
  1640. * @source studio
  1641. * @page branch selector (header / sheet / popover)
  1642. */
  1643. export interface BranchSelectorCreateClickedEvent {
  1644. action: 'branch_selector_create_clicked'
  1645. groups: TelemetryGroups
  1646. }
  1647. /**
  1648. * Triggered when a user clicks "Manage branches" in the branch selector dropdown.
  1649. *
  1650. * @group Events
  1651. * @source studio
  1652. * @page branch selector (header / sheet / popover)
  1653. */
  1654. export interface BranchSelectorManageClickedEvent {
  1655. action: 'branch_selector_manage_clicked'
  1656. groups: TelemetryGroups
  1657. }
  1658. /**
  1659. * User clicked on a DPA PDF link to open it.
  1660. *
  1661. * @group Events
  1662. * @source www, studio
  1663. */
  1664. export interface DpaPdfOpenedEvent {
  1665. action: 'dpa_pdf_opened'
  1666. properties: {
  1667. /**
  1668. * The source of the click, e.g. www, studio
  1669. */
  1670. source: 'www' | 'studio'
  1671. }
  1672. }
  1673. /**
  1674. * User clicked on an activity stat in HomeV2.
  1675. *
  1676. * @group Events
  1677. * @source studio
  1678. * @page /project/{ref}
  1679. */
  1680. export interface HomeActivityStatClickedEvent {
  1681. action: 'home_activity_stat_clicked'
  1682. properties: {
  1683. /**
  1684. * The type of activity stat clicked
  1685. */
  1686. stat_type: 'migrations' | 'backups' | 'branches'
  1687. /**
  1688. * The current value of the stat
  1689. */
  1690. stat_value: number
  1691. }
  1692. groups: TelemetryGroups
  1693. }
  1694. /**
  1695. * User clicked on a service title in Project Usage section of HomeV2.
  1696. *
  1697. * @group Events
  1698. * @source studio
  1699. * @page /project/{ref}
  1700. */
  1701. export interface HomeProjectUsageServiceClickedEvent {
  1702. action: 'home_project_usage_service_clicked'
  1703. properties: {
  1704. /**
  1705. * The service that was clicked
  1706. */
  1707. service_type: 'db' | 'functions' | 'auth' | 'storage' | 'realtime'
  1708. /**
  1709. * Total requests for this service
  1710. */
  1711. total_requests: number
  1712. /**
  1713. * Number of errors for this service (optional, only sent when error data is available)
  1714. */
  1715. error_count?: number
  1716. }
  1717. groups: TelemetryGroups
  1718. }
  1719. /**
  1720. * User clicked on a bar in the usage chart in HomeV2.
  1721. *
  1722. * @group Events
  1723. * @source studio
  1724. * @page /project/{ref}
  1725. */
  1726. export interface HomeProjectUsageChartClickedEvent {
  1727. action: 'home_project_usage_chart_clicked'
  1728. properties: {
  1729. /**
  1730. * The service type for this chart
  1731. */
  1732. service_type: 'db' | 'functions' | 'auth' | 'storage' | 'realtime'
  1733. /**
  1734. * Timestamp of the bar clicked
  1735. */
  1736. bar_timestamp: string
  1737. }
  1738. groups: TelemetryGroups
  1739. }
  1740. /**
  1741. * User added a block to the custom report in HomeV2.
  1742. *
  1743. * @group Events
  1744. * @source studio
  1745. * @page /project/{ref}
  1746. */
  1747. export interface HomeCustomReportBlockAddedEvent {
  1748. action: 'home_custom_report_block_added'
  1749. properties: {
  1750. /**
  1751. * ID of the snippet/block added
  1752. */
  1753. block_id: string
  1754. /**
  1755. * If position is 0 it is equivalent to 'Add your first chart'.
  1756. */
  1757. position: number
  1758. }
  1759. groups: TelemetryGroups
  1760. }
  1761. /**
  1762. * User removed a block from the custom report in HomeV2.
  1763. *
  1764. * @group Events
  1765. * @source studio
  1766. * @page /project/{ref}
  1767. */
  1768. export interface HomeCustomReportBlockRemovedEvent {
  1769. action: 'home_custom_report_block_removed'
  1770. properties: {
  1771. /**
  1772. * ID of the block removed
  1773. */
  1774. block_id: string
  1775. }
  1776. groups: TelemetryGroups
  1777. }
  1778. /**
  1779. * Connect section was shown to the user on the project homepage.
  1780. *
  1781. * @group Events
  1782. * @source studio
  1783. * @page /project/{ref}
  1784. */
  1785. export interface HomeConnectSectionExposedEvent {
  1786. action: 'home_connect_section_exposed'
  1787. groups: TelemetryGroups
  1788. }
  1789. /**
  1790. * User clicked a connect action tile in the Connect section on the project homepage.
  1791. *
  1792. * @group Events
  1793. * @source studio
  1794. * @page /project/{ref}
  1795. */
  1796. export interface HomeConnectActionClickedEvent {
  1797. action: 'home_connect_action_clicked'
  1798. properties: {
  1799. /**
  1800. * The connect action/tile that was clicked
  1801. */
  1802. mode: 'framework' | 'direct' | 'orm' | 'mcp' | 'api_keys'
  1803. }
  1804. groups: TelemetryGroups
  1805. }
  1806. /**
  1807. * User opened the ConnectSheet panel.
  1808. *
  1809. * @group Events
  1810. * @source studio
  1811. * @page /project/{ref}
  1812. */
  1813. export interface ConnectSheetOpenedEvent {
  1814. action: 'connect_sheet_opened'
  1815. properties: {
  1816. /**
  1817. * Where the sheet was opened from
  1818. */
  1819. source: 'header_button' | 'connect_section'
  1820. }
  1821. groups: TelemetryGroups
  1822. }
  1823. /**
  1824. * User reordered sections in HomeV2 using drag and drop.
  1825. *
  1826. * @group Events
  1827. * @source studio
  1828. * @page /project/{ref}
  1829. */
  1830. export interface HomeSectionRowsMovedEvent {
  1831. action: 'home_section_rows_moved'
  1832. properties: {
  1833. /**
  1834. * The section that was moved
  1835. */
  1836. section_moved: string
  1837. /**
  1838. * The old position of the section (0-based index)
  1839. */
  1840. old_position: number
  1841. /**
  1842. * The new position of the section (0-based index)
  1843. */
  1844. new_position: number
  1845. }
  1846. groups: TelemetryGroups
  1847. }
  1848. /**
  1849. * User clicked the Request DPA button to open the confirmation modal.
  1850. *
  1851. * @group Events
  1852. * @source studio
  1853. * @page /dashboard/org/{slug}/documents
  1854. */
  1855. export interface DpaRequestButtonClickedEvent {
  1856. action: 'dpa_request_button_clicked'
  1857. groups: Omit<TelemetryGroups, 'project'>
  1858. }
  1859. /**
  1860. * User clicked a document view/download button to access a document.
  1861. *
  1862. * @group Events
  1863. * @source studio
  1864. * @page /dashboard/org/{slug}/documents
  1865. */
  1866. export interface DocumentViewButtonClickedEvent {
  1867. action: 'document_view_button_clicked'
  1868. properties: {
  1869. /**
  1870. * The name of the document being viewed, e.g. TIA, SOC2, Standard Security Questionnaire
  1871. */
  1872. documentName: 'TIA' | 'SOC2' | 'ISO27001' | 'Standard Security Questionnaire'
  1873. }
  1874. groups: Omit<TelemetryGroups, 'project'>
  1875. }
  1876. /**
  1877. * User clicked the Request HIPAA button to open the HIPAA request form.
  1878. *
  1879. * @group Events
  1880. * @source studio
  1881. * @page /dashboard/org/{slug}/documents
  1882. */
  1883. export interface HipaaRequestButtonClickedEvent {
  1884. action: 'hipaa_request_button_clicked'
  1885. groups: Omit<TelemetryGroups, 'project'>
  1886. }
  1887. /**
  1888. * User successfully created a table in the project.
  1889. *
  1890. * @group Events
  1891. * @source studio
  1892. * @page /dashboard/project/{ref}/editor or /dashboard/project/{ref}/sql
  1893. */
  1894. export interface TableCreatedEvent {
  1895. action: 'table_created'
  1896. properties: {
  1897. /**
  1898. * Method used to create the table
  1899. */
  1900. method: 'sql_editor' | 'table_editor'
  1901. /**
  1902. * Schema where table was created
  1903. */
  1904. schema_name?: string
  1905. /**
  1906. * Name of the table created
  1907. */
  1908. table_name?: string
  1909. /**
  1910. * Whether RLS policies were generated and saved with the table
  1911. */
  1912. has_generated_policies?: boolean
  1913. }
  1914. groups: Partial<TelemetryGroups>
  1915. }
  1916. /**
  1917. * User successfully added data to a table.
  1918. *
  1919. * @group Events
  1920. * @source studio
  1921. * @page /dashboard/project/{ref}/editor or /dashboard/project/{ref}/sql
  1922. */
  1923. export interface TableDataAddedEvent {
  1924. action: 'table_data_added'
  1925. properties: {
  1926. /**
  1927. * Method used to insert data
  1928. */
  1929. method: 'sql_editor' | 'table_editor' | 'spreadsheet_import'
  1930. /**
  1931. * Schema of the table
  1932. */
  1933. schema_name?: string
  1934. /**
  1935. * Name of the table
  1936. */
  1937. table_name?: string
  1938. }
  1939. groups: Partial<TelemetryGroups>
  1940. }
  1941. /**
  1942. * User successfully enabled RLS on a table.
  1943. *
  1944. * @group Events
  1945. * @source studio
  1946. * @page /dashboard/project/{ref}/editor or /dashboard/project/{ref}/sql
  1947. */
  1948. export interface TableRLSEnabledEvent {
  1949. action: 'table_rls_enabled'
  1950. properties: {
  1951. /**
  1952. * Method used to enable RLS
  1953. */
  1954. method: 'sql_editor' | 'table_editor'
  1955. /**
  1956. * Schema of the table
  1957. */
  1958. schema_name?: string
  1959. /**
  1960. * Name of the table
  1961. */
  1962. table_name?: string
  1963. }
  1964. groups: Partial<TelemetryGroups>
  1965. }
  1966. /**
  1967. * User clicked the generate policies button in the table editor.
  1968. *
  1969. * @group Events
  1970. * @source studio
  1971. * @page /dashboard/project/{ref}/editor
  1972. */
  1973. export interface RLSGeneratePoliciesClickedEvent {
  1974. action: 'rls_generate_policies_clicked'
  1975. groups: TelemetryGroups
  1976. }
  1977. /**
  1978. * User removed a generated policy from the table editor.
  1979. *
  1980. * @group Events
  1981. * @source studio
  1982. * @page /dashboard/project/{ref}/editor
  1983. */
  1984. export interface RLSGeneratedPolicyRemovedEvent {
  1985. action: 'rls_generated_policy_removed'
  1986. groups: TelemetryGroups
  1987. }
  1988. /**
  1989. * User successfully created generated RLS policies for a table.
  1990. *
  1991. * @group Events
  1992. * @source studio
  1993. * @page /dashboard/project/{ref}/editor
  1994. */
  1995. export interface RLSGeneratedPoliciesCreatedEvent {
  1996. action: 'rls_generated_policies_created'
  1997. groups: TelemetryGroups
  1998. }
  1999. /**
  2000. * User opened API docs panel.
  2001. *
  2002. * @group Events
  2003. * @source studio
  2004. * @page Various pages with API docs button
  2005. */
  2006. export interface ApiDocsOpenedEvent {
  2007. action: 'api_docs_opened'
  2008. properties: {
  2009. /**
  2010. * Source of the API docs button click, e.g. table_editor, sidebar
  2011. */
  2012. source: string
  2013. }
  2014. groups: Partial<TelemetryGroups>
  2015. }
  2016. /**
  2017. * User clicked copy button in API docs panel.
  2018. *
  2019. * @group Events
  2020. * @source studio
  2021. * @page API docs panel
  2022. */
  2023. export interface ApiDocsCodeCopyButtonClickedEvent {
  2024. action: 'api_docs_code_copy_button_clicked'
  2025. properties: {
  2026. /**
  2027. * Title of the content being copied
  2028. */
  2029. title?: string
  2030. /**
  2031. * Selected programming language, e.g. js, bash
  2032. */
  2033. selectedLanguage?: string
  2034. }
  2035. groups: Partial<TelemetryGroups>
  2036. }
  2037. /**
  2038. * User performed a search via the Auth Users page.
  2039. *
  2040. * @group Events
  2041. * @source studio
  2042. * @page /dashboard/project/{ref}/auth/users
  2043. */
  2044. export interface AuthUsersSearchSubmittedEvent {
  2045. action: 'auth_users_search_submitted'
  2046. properties: {
  2047. /**
  2048. * The trigger that initiated the search
  2049. */
  2050. trigger:
  2051. | 'search_input'
  2052. | 'refresh_button'
  2053. | 'sort_change'
  2054. | 'provider_filter'
  2055. | 'user_type_filter'
  2056. /**
  2057. * The column being sorted on, e.g. email, phone, created_at, last_sign_in_at
  2058. */
  2059. sort_column: string
  2060. /**
  2061. * The sort order, either ascending or descending
  2062. */
  2063. sort_order: string
  2064. /**
  2065. * The authentication provider(s) being filtered on, e.g. email, phone, google, github
  2066. */
  2067. providers?: string[]
  2068. /**
  2069. * The user role(s) being filtered on, e.g. verified, unverified, anonymous
  2070. */
  2071. user_type?: string
  2072. /**
  2073. * The keywords being searched for
  2074. */
  2075. keywords?: string
  2076. /**
  2077. * The column being filtered on, e.g. email, phone
  2078. * (only included if filtering by a specific column and not all columns)
  2079. */
  2080. filter_column?: string
  2081. }
  2082. groups: TelemetryGroups
  2083. }
  2084. /**
  2085. * User opened the command menu.
  2086. *
  2087. * @group Events
  2088. * @source studio, docs, www
  2089. * @page any
  2090. */
  2091. export interface CommandMenuOpenedEvent {
  2092. action: 'command_menu_opened'
  2093. properties: {
  2094. /**
  2095. * The trigger that opened the command menu
  2096. */
  2097. trigger_type: 'keyboard_shortcut' | 'search_input'
  2098. /**
  2099. * The location where the command menu was opened
  2100. */
  2101. trigger_location?: string
  2102. /**
  2103. * In which app the command input was typed
  2104. */
  2105. app: 'studio' | 'docs' | 'www'
  2106. }
  2107. groups: Partial<TelemetryGroups>
  2108. }
  2109. /**
  2110. * User typed a search term in the command menu input.
  2111. *
  2112. * @group Events
  2113. * @source studio, docs, www
  2114. * @page any
  2115. */
  2116. export interface CommandMenuSearchSubmittedEvent {
  2117. action: 'command_menu_search_submitted'
  2118. properties: {
  2119. /**
  2120. * Search term typed into the command menu input
  2121. */
  2122. value: string
  2123. /**
  2124. * In which app the command input was typed
  2125. */
  2126. app: 'studio' | 'docs' | 'www'
  2127. }
  2128. groups: Partial<TelemetryGroups>
  2129. }
  2130. /**
  2131. * User clicked a command from the command menu.
  2132. *
  2133. * @group Events
  2134. * @source studio, docs, www
  2135. * @page any
  2136. */
  2137. export interface CommandMenuCommandClickedEvent {
  2138. action: 'command_menu_command_clicked'
  2139. properties: {
  2140. /**
  2141. * The clicked command
  2142. */
  2143. command_name: string
  2144. command_value?: string
  2145. command_type: 'action' | 'route'
  2146. /**
  2147. * The search query that was active when the command was clicked
  2148. */
  2149. search_query?: string
  2150. /**
  2151. * The path or URL the clicked item leads to (only present for route commands)
  2152. */
  2153. result_path?: string
  2154. /**
  2155. * In which app the command input was typed
  2156. */
  2157. app: 'studio' | 'docs' | 'www'
  2158. }
  2159. groups: Partial<TelemetryGroups>
  2160. }
  2161. /**
  2162. * User closed the command menu.
  2163. *
  2164. * @group Events
  2165. * @source studio, docs, www
  2166. * @page any
  2167. */
  2168. export interface CommandMenuClosedEvent {
  2169. action: 'command_menu_closed'
  2170. properties: {
  2171. /**
  2172. * In which app the command menu was closed
  2173. */
  2174. app: 'studio' | 'docs' | 'www'
  2175. }
  2176. groups: Partial<TelemetryGroups>
  2177. }
  2178. /**
  2179. * User opened a sidebar panel.
  2180. *
  2181. * @group Events
  2182. * @source studio
  2183. * @page Various pages with sidebar buttons
  2184. */
  2185. export interface SidebarOpenedEvent {
  2186. action: 'sidebar_opened'
  2187. properties: {
  2188. /**
  2189. * The sidebar panel that was opened, e.g. ai-assistant, editor-panel, advisor-panel
  2190. */
  2191. sidebar: 'ai-assistant' | 'editor-panel' | 'advisor-panel' | 'help-panel'
  2192. }
  2193. groups: TelemetryGroups
  2194. }
  2195. /**
  2196. * User opened an org menu submenu in the mobile navigation sheet.
  2197. *
  2198. * @group Events
  2199. * @source studio
  2200. * @page Organization pages (mobile)
  2201. */
  2202. export interface OrgSubmenuOpenedEvent {
  2203. action: 'org_submenu_opened'
  2204. properties: {
  2205. /** The key of the submenu item that was opened */
  2206. itemKey: string
  2207. /** The display label of the submenu item */
  2208. itemLabel: string
  2209. }
  2210. groups: TelemetryGroups
  2211. }
  2212. /**
  2213. * User clicked the back button in the mobile org menu to return to the top-level menu.
  2214. *
  2215. * @group Events
  2216. * @source studio
  2217. * @page Organization pages (mobile)
  2218. */
  2219. export interface OrgMenuBackClickedEvent {
  2220. action: 'org_menu_back_clicked'
  2221. groups: TelemetryGroups
  2222. }
  2223. /**
  2224. * User clicked a menu item in the mobile org navigation sheet.
  2225. *
  2226. * @group Events
  2227. * @source studio
  2228. * @page Organization pages (mobile)
  2229. */
  2230. export interface OrgMenuItemClickedEvent {
  2231. action: 'org_menu_item_clicked'
  2232. properties: {
  2233. /** The key identifying the menu item */
  2234. itemKey: string
  2235. /** The navigation href of the menu item */
  2236. itemHref: string
  2237. }
  2238. groups: TelemetryGroups
  2239. }
  2240. /**
  2241. * User toggled the inline editor setting in account preferences.
  2242. *
  2243. * @group Events
  2244. * @source studio
  2245. * @page /dashboard/account/preferences
  2246. */
  2247. export interface InlineEditorSettingClickedEvent {
  2248. action: 'inline_editor_setting_clicked'
  2249. properties: {
  2250. /**
  2251. * Whether the inline editor was enabled or disabled
  2252. */
  2253. enabled: boolean
  2254. }
  2255. groups: Partial<TelemetryGroups>
  2256. }
  2257. /**
  2258. * User toggled the queue table operations setting in account preferences.
  2259. *
  2260. * @group Events
  2261. * @source studio
  2262. * @page /dashboard/account/preferences
  2263. */
  2264. export interface QueueOperationsSettingClickedEvent {
  2265. action: 'queue_operations_setting_clicked'
  2266. properties: {
  2267. /**
  2268. * Whether the queue operations was enabled or disabled
  2269. */
  2270. enabled: boolean
  2271. }
  2272. groups: Partial<TelemetryGroups>
  2273. }
  2274. /**
  2275. * User clicked the save destination button in add log drains sheet.
  2276. *
  2277. * @group Events
  2278. * @source studio
  2279. * @page /dashboard/project/{ref}/settings/log-drains (LogDrainDestinationSheetForm)
  2280. */
  2281. export interface LogDrainSaveButtonClickedEvent {
  2282. action: 'log_drain_save_button_clicked'
  2283. properties: {
  2284. /**
  2285. * Type of the destination saved
  2286. */
  2287. destination:
  2288. | 'postgres'
  2289. | 'bigquery'
  2290. | 'clickhouse'
  2291. | 'webhook'
  2292. | 'datadog'
  2293. | 'elastic'
  2294. | 'loki'
  2295. | 'sentry'
  2296. | 's3'
  2297. | 'axiom'
  2298. | 'last9'
  2299. | 'otlp'
  2300. | 'syslog'
  2301. }
  2302. groups: TelemetryGroups
  2303. }
  2304. /**
  2305. * User confirmed removal of a log drain destination in the delete-confirm modal.
  2306. *
  2307. * @group Events
  2308. * @source studio
  2309. * @page /dashboard/project/{ref}/settings/log-drains
  2310. */
  2311. export interface LogDrainRemovedEvent {
  2312. action: 'log_drain_removed'
  2313. properties: {
  2314. /**
  2315. * Type of the destination removed
  2316. */
  2317. destination:
  2318. | 'postgres'
  2319. | 'bigquery'
  2320. | 'clickhouse'
  2321. | 'webhook'
  2322. | 'datadog'
  2323. | 'elastic'
  2324. | 'loki'
  2325. | 'sentry'
  2326. | 's3'
  2327. | 'axiom'
  2328. | 'last9'
  2329. | 'otlp'
  2330. | 'syslog'
  2331. }
  2332. groups: TelemetryGroups
  2333. }
  2334. type AdvisorCategory = 'PERFORMANCE' | 'SECURITY'
  2335. type AdvisorLevel = 'ERROR' | 'WARN' | 'INFO'
  2336. /**
  2337. * User opened an advisor detail page to view a specific advisor (lint, notification, or signal).
  2338. * This tracks when users engage with advisor recommendations.
  2339. *
  2340. * @group Events
  2341. * @source studio
  2342. * @page /dashboard/project/{ref}/advisors/security or home page or advisor panel sidebar
  2343. */
  2344. export interface AdvisorDetailOpenedEvent {
  2345. action: 'advisor_detail_opened'
  2346. properties: {
  2347. /**
  2348. * Where the advisor was viewed from
  2349. */
  2350. origin: 'homepage' | 'advisor_panel' | 'advisors_page'
  2351. /**
  2352. * Source of the advisor
  2353. */
  2354. advisorSource: 'lint' | 'notification' | 'signal'
  2355. /**
  2356. * Category of the advisor (SECURITY or PERFORMANCE)
  2357. */
  2358. advisorCategory?: AdvisorCategory
  2359. /**
  2360. * Specific advisor type/name, e.g. missing_index, no_rls_policy
  2361. */
  2362. advisorType?: string
  2363. /**
  2364. * Severity level of the advisor (only for lints)
  2365. */
  2366. advisorLevel?: AdvisorLevel
  2367. }
  2368. groups: TelemetryGroups
  2369. }
  2370. /**
  2371. * User clicked the Assistant button to get AI help with an advisor issue.
  2372. * This opens the AI Assistant sidebar with a pre-filled prompt about the issue.
  2373. *
  2374. * @group Events
  2375. * @source studio
  2376. * @page /dashboard/project/{ref} (homepage), /dashboard/project/{ref}/advisors/security or /dashboard/project/{ref}/advisors/performance (lint detail panel)
  2377. */
  2378. export interface AdvisorAssistantButtonClickedEvent {
  2379. action: 'advisor_assistant_button_clicked'
  2380. properties: {
  2381. /**
  2382. * Where the button was clicked
  2383. */
  2384. origin: 'homepage' | 'lint_detail'
  2385. /**
  2386. * Category of the advisor (SECURITY or PERFORMANCE)
  2387. */
  2388. advisorCategory?: AdvisorCategory
  2389. /**
  2390. * Specific advisor type/name
  2391. */
  2392. advisorType?: string
  2393. /**
  2394. * Severity level of the advisor (only for lints)
  2395. */
  2396. advisorLevel?: AdvisorLevel
  2397. /**
  2398. * Number of issues found (only included when origin is 'homepage')
  2399. */
  2400. issuesCount?: number
  2401. }
  2402. groups: TelemetryGroups
  2403. }
  2404. /**
  2405. * User clicked on "Explain with AI" button in Query Performance detail panel
  2406. *
  2407. * @group Events
  2408. * @source studio
  2409. * @page /dashboard/project/{ref}/observability/query-performance
  2410. */
  2411. export interface QueryPerformanceAIExplanationButtonClickedEvent {
  2412. action: 'query_performance_explain_with_ai_button_clicked'
  2413. groups: TelemetryGroups
  2414. }
  2415. /**
  2416. * Source/location where AI assistant actions originate from.
  2417. */
  2418. export type AiAssistantSource =
  2419. | 'explain_visualizer'
  2420. | 'query_performance'
  2421. | 'sql_debug'
  2422. | 'lint_detail'
  2423. | 'advisor_section'
  2424. | 'advisor_widget'
  2425. | 'branch_review'
  2426. | 'log_explorer'
  2427. | 'error_code'
  2428. | 'advisor_signal_detail'
  2429. | 'rls_tester'
  2430. /**
  2431. * User copied an AI prompt to clipboard instead of using the built-in assistant.
  2432. * This allows users to paste the prompt into external AI tools (Cursor, Claude, etc.)
  2433. *
  2434. * @group Events
  2435. * @source studio
  2436. */
  2437. export interface AiPromptCopiedEvent {
  2438. action: 'ai_prompt_copied'
  2439. properties: {
  2440. /**
  2441. * Source/location where the prompt was copied from
  2442. */
  2443. source: AiAssistantSource
  2444. }
  2445. groups: TelemetryGroups
  2446. }
  2447. /**
  2448. * User clicked the main AI assistant button in the dropdown.
  2449. *
  2450. * @group Events
  2451. * @source studio
  2452. */
  2453. export interface AiAssistantDropdownButtonClickedEvent {
  2454. action: 'ai_assistant_dropdown_button_clicked'
  2455. properties: {
  2456. /**
  2457. * Source/location where the button was clicked
  2458. */
  2459. source: AiAssistantSource
  2460. }
  2461. groups: TelemetryGroups
  2462. }
  2463. /**
  2464. * User clicked an external AI tool link (ChatGPT or Claude) in the dropdown.
  2465. *
  2466. * @group Events
  2467. * @source studio
  2468. */
  2469. export interface AiExternalToolClickedEvent {
  2470. action: 'ai_external_tool_clicked'
  2471. properties: {
  2472. /**
  2473. * Source/location where the link was clicked
  2474. */
  2475. source: AiAssistantSource
  2476. /**
  2477. * Which external AI tool was selected
  2478. */
  2479. tool: 'chatgpt' | 'claude'
  2480. }
  2481. groups: TelemetryGroups
  2482. }
  2483. /**
  2484. * User clicked a CTA in the project security gate.
  2485. *
  2486. * @group Events
  2487. * @source studio
  2488. */
  2489. export interface ProjectSecurityCtaClickedEvent {
  2490. action: 'project_security_cta_clicked'
  2491. properties: {
  2492. type: 'ask_assistant' | 'copy_prompt' | 'skip_to_home' | 'view_policies'
  2493. schema?: string
  2494. tableName?: string
  2495. }
  2496. groups: TelemetryGroups
  2497. }
  2498. /**
  2499. * User opened the request upgrade modal (for users without billing permissions).
  2500. *
  2501. * @group Events
  2502. * @source studio
  2503. */
  2504. export interface RequestUpgradeModalOpenedEvent {
  2505. action: 'request_upgrade_modal_opened'
  2506. properties: {
  2507. /** Target plan being requested */
  2508. requestedPlan: 'Pro' | 'Team' | 'Enterprise'
  2509. /** Addon being requested, if applicable */
  2510. addon?: 'pitr' | 'customDomain' | 'ipv4' | 'spendCap' | 'computeSize'
  2511. /** Current organization plan */
  2512. currentPlan?: string
  2513. /** Feature context driving the upgrade request */
  2514. featureProposition?: string
  2515. }
  2516. groups: Omit<TelemetryGroups, 'project'>
  2517. }
  2518. /**
  2519. * User submitted a request upgrade form to billing owners.
  2520. *
  2521. * @group Events
  2522. * @source studio
  2523. */
  2524. export interface RequestUpgradeSubmittedEvent {
  2525. action: 'request_upgrade_submitted'
  2526. properties: {
  2527. /** Target plan being requested */
  2528. requestedPlan: 'Pro' | 'Team' | 'Enterprise'
  2529. /** Addon being requested, if applicable */
  2530. addon?: 'pitr' | 'customDomain' | 'ipv4' | 'spendCap' | 'computeSize'
  2531. /** Current organization plan */
  2532. currentPlan?: string
  2533. }
  2534. groups: Omit<TelemetryGroups, 'project'>
  2535. }
  2536. /**
  2537. * Triggered when a Studio error UI element is displayed (mounted).
  2538. * This includes error Admonitions, Toast notifications, and ErrorDisplay components.
  2539. *
  2540. * @group Events
  2541. * @source studio
  2542. */
  2543. export interface DashboardErrorCreatedEvent {
  2544. action: 'dashboard_error_created'
  2545. properties: {
  2546. /**
  2547. * Source of the error
  2548. */
  2549. source?: 'admonition' | 'toast' | 'error_display'
  2550. /**
  2551. * Type of error matched (for error_display source)
  2552. */
  2553. errorType?: string
  2554. /**
  2555. * Whether troubleshooting steps are available (for error_display source)
  2556. */
  2557. hasTroubleshooting?: boolean
  2558. }
  2559. groups: TelemetryGroups
  2560. }
  2561. /**
  2562. * Triggered when the inline error troubleshooter is shown to the user.
  2563. *
  2564. * @group Events
  2565. * @source studio
  2566. */
  2567. export interface InlineErrorTroubleshooterExposedEvent {
  2568. action: 'inline_error_troubleshooter_exposed'
  2569. properties: {
  2570. /** ID of the matched error mapping */
  2571. errorType: string
  2572. }
  2573. groups: TelemetryGroups
  2574. }
  2575. /**
  2576. * Triggered when a user opens or closes a troubleshooting accordion step.
  2577. *
  2578. * @group Events
  2579. * @source studio
  2580. */
  2581. export interface InlineErrorTroubleshooterStepClickedEvent {
  2582. action: 'inline_error_troubleshooter_step_clicked'
  2583. properties: {
  2584. /** ID of the matched error mapping */
  2585. errorType: string
  2586. /** Step number that was clicked (1, 2, 3, ...) — null when a step is collapsed */
  2587. step: number | null
  2588. /** Title of the step that was clicked */
  2589. stepTitle?: string
  2590. /** Whether the step was opened (true) or closed (false) */
  2591. expanded: boolean
  2592. }
  2593. groups: TelemetryGroups
  2594. }
  2595. /**
  2596. * Triggered when a user clicks an action within the inline error troubleshooter.
  2597. * Covers all CTAs including the contact support link.
  2598. *
  2599. * @group Events
  2600. * @source studio
  2601. */
  2602. export interface InlineErrorTroubleshooterActionClickedEvent {
  2603. action: 'inline_error_troubleshooter_action_clicked'
  2604. properties: {
  2605. /** ID of the matched error mapping */
  2606. errorType: string
  2607. /** Which CTA was clicked */
  2608. ctaType: 'restart_db' | 'troubleshooting_guide' | 'ask_ai' | 'contact_support'
  2609. }
  2610. groups: TelemetryGroups
  2611. }
  2612. /**
  2613. * User successfully completed installing an integration via the integrations marketplace in the dashboard.
  2614. * Note: This excludes Wrappers and Postgres Extensions. Previously: integration_installed
  2615. *
  2616. * @group Events
  2617. * @source studio
  2618. * @page /dashboard/project/{ref}/integrations/{integration_slug}
  2619. */
  2620. export interface IntegrationInstallCompletedEvent {
  2621. action: 'integration_install_completed'
  2622. properties: {
  2623. /**
  2624. * The name of the integration installed
  2625. */
  2626. integrationName: string
  2627. }
  2628. groups: TelemetryGroups
  2629. }
  2630. /**
  2631. * User submitted an integration install via the integrations marketplace. Previously: integration_install_started
  2632. *
  2633. * @group Events
  2634. * @source studio
  2635. * @page /dashboard/project/{ref}/integrations/{integration_slug}
  2636. */
  2637. export interface IntegrationInstallSubmittedEvent {
  2638. action: 'integration_install_submitted'
  2639. properties: {
  2640. /** The name of the integration being installed */
  2641. integrationName: string
  2642. /** The integration method (will be 'template' for frontend-driven integrations.) */
  2643. method: string
  2644. }
  2645. groups: TelemetryGroups
  2646. }
  2647. /**
  2648. * User submitted an integration uninstall via the integrations marketplace. Previously: integration_uninstall_started
  2649. *
  2650. * @group Events
  2651. * @source studio
  2652. * @page /dashboard/project/{ref}/integrations/{integration_slug}
  2653. */
  2654. export interface IntegrationUninstallSubmittedEvent {
  2655. action: 'integration_uninstall_submitted'
  2656. properties: {
  2657. /**
  2658. * The name of the integration being uninstalled
  2659. */
  2660. integrationName: string
  2661. }
  2662. groups: TelemetryGroups
  2663. }
  2664. /**
  2665. * Installation failed for an integration.
  2666. *
  2667. * @group Events
  2668. * @source studio
  2669. * @page /dashboard/project/{ref}/integrations/{integration_slug}
  2670. */
  2671. export interface IntegrationInstallFailedEvent {
  2672. action: 'integration_install_failed'
  2673. properties: {
  2674. /**
  2675. * The name of the integration whose installation failed
  2676. */
  2677. integrationName: string
  2678. }
  2679. groups: TelemetryGroups
  2680. }
  2681. /**
  2682. * User successfully completed uninstalling an integration via the integrations marketplace in the dashboard.
  2683. * Note: This excludes Wrappers and Postgres Extensions. Previously: integration_uninstalled
  2684. *
  2685. * @group Events
  2686. * @source studio
  2687. * @page /dashboard/project/{ref}/integrations/{integration_slug}
  2688. */
  2689. export interface IntegrationUninstallCompletedEvent {
  2690. action: 'integration_uninstall_completed'
  2691. properties: {
  2692. /**
  2693. * The name of the integration installed
  2694. */
  2695. integrationName: string
  2696. }
  2697. groups: TelemetryGroups
  2698. }
  2699. /**
  2700. * User clicked the enable Create rls_ensure trigger button in the RLS Event Trigger banner.
  2701. *
  2702. * @group Events
  2703. * @source studio
  2704. * @page /project/{ref}/auth/policies
  2705. */
  2706. export interface RlsEventTriggerBannerCreateButtonClickedEvent {
  2707. action: 'rls_event_trigger_banner_create_button_clicked'
  2708. groups: TelemetryGroups
  2709. }
  2710. /**
  2711. * User clicked the Run button in the log explorer.
  2712. *
  2713. * @group Events
  2714. * @source studio
  2715. * @page /project/{ref}/logs/explorer
  2716. */
  2717. export interface LogExplorerQueryRunButtonClickedEvent {
  2718. action: 'log_explorer_query_run_button_clicked'
  2719. properties: {
  2720. /**
  2721. * Whether the user is editing a saved query
  2722. */
  2723. is_saved_query: boolean
  2724. }
  2725. groups: TelemetryGroups
  2726. }
  2727. /**
  2728. * User clicked an upgrade CTA inside the compute badge hover card.
  2729. *
  2730. * @group Events
  2731. * @source studio
  2732. */
  2733. export interface ComputeBadgeUpgradeClickedEvent {
  2734. action: 'compute_badge_upgrade_clicked'
  2735. properties: {
  2736. computeSize: string
  2737. planId: string
  2738. upgradeType: 'pro_upgrade' | 'free_micro_upgrade' | 'compute_upgrade'
  2739. }
  2740. groups: TelemetryGroups
  2741. }
  2742. /**
  2743. * Fly.io deprecation banner rendered for a user with at least one Fly.io project or branch.
  2744. *
  2745. * @group Events
  2746. * @source studio
  2747. */
  2748. export interface FlyDeprecationBannerExposedEvent {
  2749. action: 'fly_deprecation_banner_exposed'
  2750. groups: TelemetryGroups
  2751. properties: {
  2752. primaryCount: number
  2753. branchCount: number
  2754. }
  2755. }
  2756. /**
  2757. * User dismissed the Fly.io deprecation banner.
  2758. *
  2759. * @group Events
  2760. * @source studio
  2761. */
  2762. export interface FlyDeprecationBannerDismissedEvent {
  2763. action: 'fly_deprecation_banner_dismissed'
  2764. groups: TelemetryGroups
  2765. properties: {
  2766. primaryCount: number
  2767. branchCount: number
  2768. }
  2769. }
  2770. /**
  2771. * User dismissed the free Micro upgrade banner.
  2772. *
  2773. * @group Events
  2774. * @source studio
  2775. */
  2776. export interface FreeMicroUpgradeBannerDismissedEvent {
  2777. action: 'free_micro_upgrade_banner_dismissed'
  2778. groups: TelemetryGroups
  2779. }
  2780. /**
  2781. * User clicked the CTA on the free Micro upgrade banner.
  2782. *
  2783. * @group Events
  2784. * @source studio
  2785. */
  2786. export interface FreeMicroUpgradeBannerCtaClickedEvent {
  2787. action: 'free_micro_upgrade_banner_cta_clicked'
  2788. groups: TelemetryGroups
  2789. }
  2790. /**
  2791. * User clicked the Navigate action in the storage explorer header.
  2792. *
  2793. * @group Events
  2794. * @source studio
  2795. * @page /project/{ref}/storage/files/buckets/{bucketId}
  2796. */
  2797. export interface StorageExplorerNavigateClickedEvent {
  2798. action: 'storage_explorer_navigate_clicked'
  2799. groups: TelemetryGroups
  2800. }
  2801. /**
  2802. * User submitted a folder path from the storage explorer Navigate action.
  2803. *
  2804. * @group Events
  2805. * @source studio
  2806. * @page /project/{ref}/storage/files/buckets/{bucketId}
  2807. */
  2808. export interface StorageExplorerNavigateSubmittedEvent {
  2809. action: 'storage_explorer_navigate_submitted'
  2810. groups: TelemetryGroups
  2811. }
  2812. /**
  2813. * User clicked the Remove policy button on the public bucket SELECT policy warning.
  2814. *
  2815. * @group Events
  2816. * @source studio
  2817. * @page /project/{ref}/storage/files/buckets/{bucketId}
  2818. */
  2819. export interface StoragePublicBucketSelectPolicyRemovedEvent {
  2820. action: 'storage_public_bucket_select_policy_removed'
  2821. properties: {
  2822. /** The ID of the bucket whose SELECT policy was removed */
  2823. bucketId: string
  2824. }
  2825. groups: TelemetryGroups
  2826. }
  2827. /**
  2828. * User dismissed the public bucket SELECT policy warning banner.
  2829. *
  2830. * @group Events
  2831. * @source studio
  2832. * @page /project/{ref}/storage/files/buckets/{bucketId}
  2833. */
  2834. export interface StoragePublicBucketSelectPolicyWarningDismissButtonClickedEvent {
  2835. action: 'storage_public_bucket_select_policy_warning_dismiss_button_clicked'
  2836. properties: {
  2837. /** The ID of the bucket whose warning was dismissed */
  2838. bucketId: string
  2839. }
  2840. groups: TelemetryGroups
  2841. }
  2842. /**
  2843. * Triggered when an access token is successfully created.
  2844. *
  2845. * @group Events
  2846. * @source studio
  2847. * @page /account/tokens
  2848. */
  2849. export interface AccessTokenCreatedEvent {
  2850. action: 'access_token_created'
  2851. properties: {
  2852. tokenType: 'classic' | 'scoped'
  2853. expiryPreset: string
  2854. resourceAccess?: 'all-orgs' | 'selected-orgs' | 'selected-projects'
  2855. permissionCount?: number
  2856. }
  2857. groups: Omit<TelemetryGroups, 'project'>
  2858. }
  2859. /**
  2860. * Triggered when an access token is successfully deleted.
  2861. *
  2862. * @group Events
  2863. * @source studio
  2864. * @page /account/tokens
  2865. */
  2866. export interface AccessTokenRemovedEvent {
  2867. action: 'access_token_removed'
  2868. properties: {
  2869. tokenType: 'classic' | 'scoped'
  2870. }
  2871. groups: Omit<TelemetryGroups, 'project'>
  2872. }
  2873. /**
  2874. * User clicked the primary CTA on a resource exhaustion warning banner.
  2875. *
  2876. * @group Events
  2877. * @source studio
  2878. */
  2879. export interface ResourceExhaustionBannerUpgradeClickedEvent {
  2880. action: 'resource_exhaustion_banner_upgrade_clicked'
  2881. groups: TelemetryGroups
  2882. properties: {
  2883. warningTypes: string[]
  2884. destination: string
  2885. }
  2886. }
  2887. /**
  2888. * User clicked "Ask AI Assistant" on a resource exhaustion warning banner.
  2889. *
  2890. * @group Events
  2891. * @source studio
  2892. */
  2893. export interface ResourceExhaustionBannerAiAssistantClickedEvent {
  2894. action: 'resource_exhaustion_banner_ai_assistant_clicked'
  2895. groups: TelemetryGroups
  2896. properties: {
  2897. warningTypes: string[]
  2898. }
  2899. }
  2900. /**
  2901. * User clicked a row in the Unified Logs interface.
  2902. *
  2903. * @group Events
  2904. * @source studio
  2905. */
  2906. export interface UnifiedLogsRowClickedEvent {
  2907. action: 'unified_logs_row_clicked'
  2908. properties: {
  2909. /**
  2910. * Service that produced the log row. Mirrors `LOG_TYPES` in UnifiedLogs.constants.tsx.
  2911. * Server values are validated against this set by zod (UnifiedLogs.schema.ts) before
  2912. * reaching the table; anything else is rejected upstream so the union here is exhaustive.
  2913. */
  2914. logType: 'postgres' | 'postgrest' | 'auth' | 'storage' | 'edge function'
  2915. }
  2916. groups: TelemetryGroups
  2917. }
  2918. /**
  2919. * User clicked the Briven logo in the top-left corner of the page header.
  2920. *
  2921. * @group Events
  2922. * @source studio
  2923. */
  2924. export interface HeaderHomeLogoClickedEvent {
  2925. action: 'header_home_logo_clicked'
  2926. groups: Partial<TelemetryGroups>
  2927. }
  2928. /**
  2929. * User clicked the mobile back-to-dashboard chevron in the page header.
  2930. *
  2931. * @group Events
  2932. * @source studio
  2933. */
  2934. export interface HeaderBackToDashboardClickedEvent {
  2935. action: 'header_back_to_dashboard_clicked'
  2936. groups: Partial<TelemetryGroups>
  2937. }
  2938. /**
  2939. * User clicked the "Exceeding usage limits" badge in the page header.
  2940. *
  2941. * @group Events
  2942. * @source studio
  2943. */
  2944. export interface HeaderExceedingUsageBadgeClickedEvent {
  2945. action: 'header_exceeding_usage_badge_clicked'
  2946. groups: Partial<TelemetryGroups>
  2947. }
  2948. /**
  2949. * User opened the organization dropdown in the page header.
  2950. *
  2951. * @group Events
  2952. * @source studio
  2953. */
  2954. export interface HeaderOrganizationDropdownOpenedEvent {
  2955. action: 'header_organization_dropdown_opened'
  2956. groups: Partial<TelemetryGroups>
  2957. }
  2958. /**
  2959. * User opened the project dropdown in the page header.
  2960. *
  2961. * @group Events
  2962. * @source studio
  2963. */
  2964. export interface HeaderProjectDropdownOpenedEvent {
  2965. action: 'header_project_dropdown_opened'
  2966. groups: Partial<TelemetryGroups>
  2967. }
  2968. /**
  2969. * User opened the branch dropdown in the page header.
  2970. *
  2971. * @group Events
  2972. * @source studio
  2973. */
  2974. export interface HeaderBranchDropdownOpenedEvent {
  2975. action: 'header_branch_dropdown_opened'
  2976. groups: Partial<TelemetryGroups>
  2977. }
  2978. /**
  2979. * User clicked the merge-request trigger button in the page header.
  2980. * Fires on click; the existing branch_create_merge_request_button_clicked
  2981. * fires only on successful merge-request creation.
  2982. *
  2983. * @group Events
  2984. * @source studio
  2985. */
  2986. export interface HeaderMergeRequestButtonClickedEvent {
  2987. action: 'header_merge_request_button_clicked'
  2988. properties: {
  2989. /** Whether a review has already been requested for this branch. */
  2990. hasReviewRequested: boolean
  2991. }
  2992. groups: TelemetryGroups
  2993. }
  2994. /**
  2995. * User clicked the "Connect" button in the page header.
  2996. *
  2997. * @group Events
  2998. * @source studio
  2999. */
  3000. export interface HeaderConnectButtonClickedEvent {
  3001. action: 'header_connect_button_clicked'
  3002. groups: TelemetryGroups
  3003. }
  3004. /**
  3005. * User opened the feedback dropdown in the page header.
  3006. *
  3007. * @group Events
  3008. * @source studio
  3009. */
  3010. export interface HeaderFeedbackDropdownOpenedEvent {
  3011. action: 'header_feedback_dropdown_opened'
  3012. groups: Partial<TelemetryGroups>
  3013. }
  3014. /**
  3015. * User clicked the Advisor Center toggle button in the page header.
  3016. *
  3017. * @group Events
  3018. * @source studio
  3019. */
  3020. export interface HeaderAdvisorButtonClickedEvent {
  3021. action: 'header_advisor_button_clicked'
  3022. groups: Partial<TelemetryGroups>
  3023. }
  3024. /**
  3025. * User clicked the Inline SQL Editor toggle button in the page header.
  3026. *
  3027. * @group Events
  3028. * @source studio
  3029. */
  3030. export interface HeaderInlineEditorButtonClickedEvent {
  3031. action: 'header_inline_editor_button_clicked'
  3032. groups: Partial<TelemetryGroups>
  3033. }
  3034. /**
  3035. * User clicked the AI Assistant toggle button in the page header.
  3036. *
  3037. * @group Events
  3038. * @source studio
  3039. */
  3040. export interface HeaderAssistantButtonClickedEvent {
  3041. action: 'header_assistant_button_clicked'
  3042. groups: Partial<TelemetryGroups>
  3043. }
  3044. /**
  3045. * User opened the user/account dropdown in the page header.
  3046. *
  3047. * @group Events
  3048. * @source studio
  3049. */
  3050. export interface HeaderUserDropdownOpenedEvent {
  3051. action: 'header_user_dropdown_opened'
  3052. groups: Partial<TelemetryGroups>
  3053. }
  3054. /**
  3055. * User opened the local-development settings dropdown in the page header.
  3056. *
  3057. * @group Events
  3058. * @source studio
  3059. */
  3060. export interface HeaderLocalDropdownOpenedEvent {
  3061. action: 'header_local_dropdown_opened'
  3062. groups: Partial<TelemetryGroups>
  3063. }
  3064. /**
  3065. * User opened the local CLI version popover in the page header.
  3066. *
  3067. * @group Events
  3068. * @source studio
  3069. */
  3070. export interface HeaderLocalVersionPopoverOpenedEvent {
  3071. action: 'header_local_version_popover_opened'
  3072. groups: Partial<TelemetryGroups>
  3073. }
  3074. /**
  3075. * User ran a query in the RLS tester feature preview.
  3076. *
  3077. * @group Events
  3078. * @source studio
  3079. */
  3080. export interface RLSTesterRunQueryClickedEvent {
  3081. action: 'rls_tester_run_query_clicked'
  3082. properties: { type: 'raw' | 'inferred' }
  3083. groups: Partial<TelemetryGroups>
  3084. }
  3085. /**
  3086. * @hidden
  3087. */
  3088. export type TelemetryEvent =
  3089. | SignUpEvent
  3090. | SignInEvent
  3091. | ConnectionStringCopiedEvent
  3092. | McpInstallButtonClickedEvent
  3093. | ApiDocsOpenedEvent
  3094. | ApiDocsCodeCopyButtonClickedEvent
  3095. | CronJobCreatedEvent
  3096. | CronJobUpdatedEvent
  3097. | CronJobRemovedEvent
  3098. | CronJobCreateClickedEvent
  3099. | CronJobUpdateClickedEvent
  3100. | CronJobDeleteClickedEvent
  3101. | CronJobHistoryClickedEvent
  3102. | FeaturePreviewEnabledEvent
  3103. | FeaturePreviewDisabledEvent
  3104. | TimezonePickerClickedEvent
  3105. | ProjectCreationDefaultPrivilegesExposedEvent
  3106. | ProjectCreationGithubConnectClickedEvent
  3107. | ProjectCreationSimpleVersionSubmittedEvent
  3108. | ProjectCreationSimpleVersionConfirmModalOpenedEvent
  3109. | TableApiAccessToggleClickedEvent
  3110. | RealtimeInspectorListenChannelClickedEvent
  3111. | RealtimeInspectorBroadcastSentEvent
  3112. | RealtimeInspectorMessageClickedEvent
  3113. | RealtimeInspectorCopyMessageClickedEvent
  3114. | RealtimeInspectorFiltersAppliedEvent
  3115. | RealtimeInspectorDatabaseRoleUpdatedEvent
  3116. | RealtimeToggleTableClickedEvent
  3117. | TableRealtimeEnabledEvent
  3118. | TableRealtimeDisabledEvent
  3119. | SqlEditorQuickstartClickedEvent
  3120. | SqlEditorTemplateClickedEvent
  3121. | SqlEditorResultDownloadCsvClickedEvent
  3122. | SqlEditorResultCopyMarkdownClickedEvent
  3123. | SqlEditorResultCopyJsonClickedEvent
  3124. | SqlEditorResultCopyCsvClickedEvent
  3125. | AssistantPromptSubmittedEvent
  3126. | AssistantDebugSubmittedEvent
  3127. | AssistantSuggestionRunQueryClickedEvent
  3128. | AssistantSqlDiffHandlerEvaluatedEvent
  3129. | AssistantEditInSqlEditorClickedEvent
  3130. | AssistantMessageRatingSubmittedEvent
  3131. | DocsFeedbackClickedEvent
  3132. | CopyAsMarkdownEvent
  3133. | AskAIEvent
  3134. | HomepageFrameworkQuickstartClickedEvent
  3135. | HomepageProductCardClickedEvent
  3136. | WwwPricingPlanCtaClickedEvent
  3137. | EventPageCtaClickedEvent
  3138. | HomepageGitHubButtonClickedEvent
  3139. | HomepageDiscordButtonClickedEvent
  3140. | HomepageCustomerStoryCardClickedEvent
  3141. | HomepageProjectTemplateCardClickedEvent
  3142. | CustomReportAddSQLBlockClickedEvent
  3143. | CustomReportAssistantSQLBlockAddedEvent
  3144. | OpenSourceRepoCardClickedEvent
  3145. | StartProjectButtonClickedEvent
  3146. | SeeDocumentationButtonClickedEvent
  3147. | RequestDemoButtonClickedEvent
  3148. | SignInButtonClickedEvent
  3149. | HelpButtonClickedEvent
  3150. | ExampleProjectCardClickedEvent
  3151. | ImportDataButtonClickedEvent
  3152. | ImportDataFileAddedEvent
  3153. | ImportDataAddedEvent
  3154. | SendFeedbackButtonClickedEvent
  3155. | SqlEditorQueryRunButtonClickedEvent
  3156. | LogExplorerQueryRunButtonClickedEvent
  3157. | StorageExplorerNavigateClickedEvent
  3158. | StorageExplorerNavigateSubmittedEvent
  3159. | StoragePublicBucketSelectPolicyRemovedEvent
  3160. | StoragePublicBucketSelectPolicyWarningDismissButtonClickedEvent
  3161. | StudioPricingPlanCtaClickedEvent
  3162. | StudioPricingSidePanelOpenedEvent
  3163. | ReportsDatabaseGrafanaBannerClickedEvent
  3164. | MetricsAPIBannerCtaButtonClickedEvent
  3165. | MetricsAPIBannerDismissButtonClickedEvent
  3166. | IndexAdvisorEnableButtonClickedEvent
  3167. | IndexAdvisorBannerDismissButtonClickedEvent
  3168. | IndexAdvisorTabClickedEvent
  3169. | IndexAdvisorCreateIndexesButtonClickedEvent
  3170. | EdgeFunctionDeployButtonClickedEvent
  3171. | EdgeFunctionDeployUpdatesConfirmClickedEvent
  3172. | EdgeFunctionAiAssistantButtonClickedEvent
  3173. | EdgeFunctionViaEditorButtonClickedEvent
  3174. | EdgeFunctionTemplateClickedEvent
  3175. | EdgeFunctionViaCliButtonClickedEvent
  3176. | EdgeFunctionDeployUpdatesButtonClickedEvent
  3177. | EdgeFunctionTestSendButtonClickedEvent
  3178. | EdgeFunctionTestSidePanelOpenedEvent
  3179. | BrivenUiCommandCopyButtonClickedEvent
  3180. | SupportTicketSubmittedEvent
  3181. | AiAssistantInSupportFormClickedEvent
  3182. | OrganizationMfaEnforcementUpdatedEvent
  3183. | ForeignDataWrapperCreatedEvent
  3184. | StorageBucketCreatedEvent
  3185. | BranchCreateButtonClickedEvent
  3186. | BranchDeleteButtonClickedEvent
  3187. | BranchCreateMergeRequestButtonClickedEvent
  3188. | BranchCloseMergeRequestButtonClickedEvent
  3189. | BranchMergeSubmittedEvent
  3190. | BranchMergeCompletedEvent
  3191. | BranchMergeFailedEvent
  3192. | BranchUpdatedEvent
  3193. | BranchReviewWithAssistantClickedEvent
  3194. | BranchSelectorBranchClickedEvent
  3195. | BranchSelectorCreateClickedEvent
  3196. | BranchSelectorManageClickedEvent
  3197. | DpaPdfOpenedEvent
  3198. | HomeConnectSectionExposedEvent
  3199. | HomeConnectActionClickedEvent
  3200. | ConnectSheetOpenedEvent
  3201. | HomeSectionRowsMovedEvent
  3202. | HomeActivityStatClickedEvent
  3203. | HomeProjectUsageServiceClickedEvent
  3204. | HomeProjectUsageChartClickedEvent
  3205. | HomeCustomReportBlockAddedEvent
  3206. | HomeCustomReportBlockRemovedEvent
  3207. | DpaRequestButtonClickedEvent
  3208. | DocumentViewButtonClickedEvent
  3209. | HipaaRequestButtonClickedEvent
  3210. | TableCreatedEvent
  3211. | TableDataAddedEvent
  3212. | TableRLSEnabledEvent
  3213. | RLSGeneratePoliciesClickedEvent
  3214. | RLSGeneratedPolicyRemovedEvent
  3215. | RLSGeneratedPoliciesCreatedEvent
  3216. | AuthUsersSearchSubmittedEvent
  3217. | CommandMenuOpenedEvent
  3218. | CommandMenuClosedEvent
  3219. | CommandMenuSearchSubmittedEvent
  3220. | CommandMenuCommandClickedEvent
  3221. | InlineEditorSettingClickedEvent
  3222. | QueueOperationsSettingClickedEvent
  3223. | SidebarOpenedEvent
  3224. | LogDrainSaveButtonClickedEvent
  3225. | LogDrainRemovedEvent
  3226. | AdvisorDetailOpenedEvent
  3227. | AdvisorAssistantButtonClickedEvent
  3228. | QueryPerformanceAIExplanationButtonClickedEvent
  3229. | AiPromptCopiedEvent
  3230. | AiAssistantDropdownButtonClickedEvent
  3231. | AiExternalToolClickedEvent
  3232. | ProjectSecurityCtaClickedEvent
  3233. | RequestUpgradeModalOpenedEvent
  3234. | RequestUpgradeSubmittedEvent
  3235. | DashboardErrorCreatedEvent
  3236. | InlineErrorTroubleshooterExposedEvent
  3237. | InlineErrorTroubleshooterStepClickedEvent
  3238. | InlineErrorTroubleshooterActionClickedEvent
  3239. | IntegrationInstallCompletedEvent
  3240. | IntegrationInstallSubmittedEvent
  3241. | IntegrationUninstallSubmittedEvent
  3242. | IntegrationInstallFailedEvent
  3243. | IntegrationUninstallCompletedEvent
  3244. | RlsEventTriggerBannerCreateButtonClickedEvent
  3245. | OrgSubmenuOpenedEvent
  3246. | OrgMenuBackClickedEvent
  3247. | OrgMenuItemClickedEvent
  3248. | ComputeBadgeUpgradeClickedEvent
  3249. | FlyDeprecationBannerExposedEvent
  3250. | FlyDeprecationBannerDismissedEvent
  3251. | FreeMicroUpgradeBannerDismissedEvent
  3252. | FreeMicroUpgradeBannerCtaClickedEvent
  3253. | AccessTokenCreatedEvent
  3254. | AccessTokenRemovedEvent
  3255. | ResourceExhaustionBannerUpgradeClickedEvent
  3256. | ResourceExhaustionBannerAiAssistantClickedEvent
  3257. | UnifiedLogsRowClickedEvent
  3258. | HeaderHomeLogoClickedEvent
  3259. | HeaderBackToDashboardClickedEvent
  3260. | HeaderExceedingUsageBadgeClickedEvent
  3261. | HeaderOrganizationDropdownOpenedEvent
  3262. | HeaderProjectDropdownOpenedEvent
  3263. | HeaderBranchDropdownOpenedEvent
  3264. | HeaderMergeRequestButtonClickedEvent
  3265. | HeaderConnectButtonClickedEvent
  3266. | HeaderFeedbackDropdownOpenedEvent
  3267. | HeaderAdvisorButtonClickedEvent
  3268. | HeaderInlineEditorButtonClickedEvent
  3269. | HeaderAssistantButtonClickedEvent
  3270. | HeaderUserDropdownOpenedEvent
  3271. | HeaderLocalDropdownOpenedEvent
  3272. | HeaderLocalVersionPopoverOpenedEvent
  3273. | RLSTesterRunQueryClickedEvent