@nangohq/types 0.71.13 → 0.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,700 @@
1
+ import * as z from 'zod';
2
+ import type { AgentSessionMetaTool, AgentSessionToolSearchHit } from '../agent/session.js';
3
+ import type { CliTelemetryCommand } from '../cli/api.js';
4
+ import type { HTTP_METHOD } from '../nangoYaml/index.js';
5
+ import type { GrowthAddonState } from '../plans/http.api.js';
6
+ import type { UsageMetric } from '../usage/index.js';
7
+ import type { AnalyticsSurface } from './taxonomy.js';
8
+ export interface AnalyticsEventDefinition {
9
+ surface: AnalyticsSurface;
10
+ insight: string;
11
+ fires: string;
12
+ properties: z.ZodType;
13
+ }
14
+ /** Senders add `surface`, and the server adds `is_production` when it knows the environment. `properties` lists the rest. */
15
+ export declare const analyticsEventCatalogue: {
16
+ readonly 'billing:usage_update': {
17
+ readonly surface: "web";
18
+ readonly insight: "Which Usage page controls people use, and which metrics and dimensions they break usage down by";
19
+ readonly fires: "When someone changes the month, a breakdown, a filter or a series on the Usage page";
20
+ readonly properties: z.ZodUnion<readonly [z.ZodObject<{
21
+ change: z.ZodLiteral<"month">;
22
+ direction: z.ZodEnum<{
23
+ previous: "previous";
24
+ next: "next";
25
+ }>;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ change: z.ZodEnum<{
28
+ filter: "filter";
29
+ group: "group";
30
+ }>;
31
+ metric: z.ZodType<UsageMetric, unknown, z.core.$ZodTypeInternals<UsageMetric, unknown>>;
32
+ dimension: z.ZodType<"environment_id" | "source" | "success" | "connection_id" | "integration_id" | "function_name" | "function_type" | "model", unknown, z.core.$ZodTypeInternals<"environment_id" | "source" | "success" | "connection_id" | "integration_id" | "function_name" | "function_type" | "model", unknown>>;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ change: z.ZodEnum<{
35
+ group_clear: "group_clear";
36
+ filter_clear: "filter_clear";
37
+ series_isolate: "series_isolate";
38
+ series_toggle: "series_toggle";
39
+ }>;
40
+ metric: z.ZodType<UsageMetric, unknown, z.core.$ZodTypeInternals<UsageMetric, unknown>>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ change: z.ZodLiteral<"legacy_metrics">;
43
+ is_legacy_metrics_shown: z.ZodBoolean;
44
+ }, z.core.$strip>]>;
45
+ };
46
+ readonly 'billing:filter_button_click': {
47
+ readonly surface: "web";
48
+ readonly insight: "How often people look for a breakdown filter, and on which metric";
49
+ readonly fires: "When someone opens the breakdown filter on a usage chart";
50
+ readonly properties: z.ZodObject<{
51
+ metric: z.ZodType<UsageMetric, unknown, z.core.$ZodTypeInternals<UsageMetric, unknown>>;
52
+ }, z.core.$strip>;
53
+ };
54
+ readonly 'billing:copy_button_click': {
55
+ readonly surface: "web";
56
+ readonly insight: "How often people copy a breakdown value out of a usage chart, and for which metric and dimension";
57
+ readonly fires: "When someone copies a breakdown value on a usage chart";
58
+ readonly properties: z.ZodObject<{
59
+ metric: z.ZodType<UsageMetric, unknown, z.core.$ZodTypeInternals<UsageMetric, unknown>>;
60
+ dimension: z.ZodType<"environment_id" | "source" | "success" | "connection_id" | "integration_id" | "function_name" | "function_type" | "model", unknown, z.core.$ZodTypeInternals<"environment_id" | "source" | "success" | "connection_id" | "integration_id" | "function_name" | "function_type" | "model", unknown>>;
61
+ }, z.core.$strip>;
62
+ };
63
+ readonly 'billing:open_link_click': {
64
+ readonly surface: "web";
65
+ readonly insight: "How often a usage breakdown leads people to the integration or connection behind it";
66
+ readonly fires: "When someone opens the item behind a breakdown value on a usage chart";
67
+ readonly properties: z.ZodObject<{
68
+ metric: z.ZodType<UsageMetric, unknown, z.core.$ZodTypeInternals<UsageMetric, unknown>>;
69
+ dimension: z.ZodType<"environment_id" | "source" | "success" | "connection_id" | "integration_id" | "function_name" | "function_type" | "model", unknown, z.core.$ZodTypeInternals<"environment_id" | "source" | "success" | "connection_id" | "integration_id" | "function_name" | "function_type" | "model", unknown>>;
70
+ }, z.core.$strip>;
71
+ };
72
+ readonly 'billing:invoice_link_click': {
73
+ readonly surface: "web";
74
+ readonly insight: "How often accounts open their invoices from Billing & Usage";
75
+ readonly fires: "When someone opens an invoice from the Billing page";
76
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
77
+ };
78
+ readonly 'billing:portal_link_click': {
79
+ readonly surface: "web";
80
+ readonly insight: "How often accounts need the billing portal";
81
+ readonly fires: "When someone opens the billing portal from the Usage page";
82
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
83
+ };
84
+ readonly 'billing:upgrade_button_click': {
85
+ readonly surface: "web";
86
+ readonly insight: "How many accounts start an upgrade from a plan card, the first step of the upgrade funnel";
87
+ readonly fires: "When someone clicks to upgrade on a plan card";
88
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
89
+ };
90
+ readonly 'billing:addon_button_click': {
91
+ readonly surface: "web";
92
+ readonly insight: "How many accounts act on the Growth add-on, split by whether they already have it";
93
+ readonly fires: "When someone clicks the Growth add-on action on the Billing page";
94
+ readonly properties: z.ZodObject<{
95
+ addon_state: z.ZodType<GrowthAddonState, unknown, z.core.$ZodTypeInternals<GrowthAddonState, unknown>>;
96
+ }, z.core.$strip>;
97
+ };
98
+ readonly 'billing:payment_method_button_click': {
99
+ readonly surface: "web";
100
+ readonly insight: "How many accounts start adding a payment method";
101
+ readonly fires: "When someone clicks to add a payment method on the Billing page";
102
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
103
+ };
104
+ readonly 'billing:overdue_alert_link_click': {
105
+ readonly surface: "web";
106
+ readonly insight: "Whether the overdue-invoice alert gets accounts to look at their invoices";
107
+ readonly fires: "When someone follows the overdue-invoice alert in the sidebar";
108
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
109
+ };
110
+ readonly 'billing:plan_submit': {
111
+ readonly surface: "server";
112
+ readonly insight: "Which plan changes accounts ask for, including downgrades that take effect later";
113
+ readonly fires: "After the server accepts a plan change requested in the dashboard";
114
+ readonly properties: z.ZodObject<{
115
+ previous_plan: z.ZodString;
116
+ plan: z.ZodString;
117
+ previous_has_growth_addon: z.ZodBoolean;
118
+ has_growth_addon: z.ZodBoolean;
119
+ is_downgrade: z.ZodBoolean;
120
+ }, z.core.$strip>;
121
+ };
122
+ readonly 'billing:plan_update': {
123
+ readonly surface: "server";
124
+ readonly insight: "How many accounts upgrade and downgrade each month, counted when the change takes effect";
125
+ readonly fires: "After an account's plan changes in our database";
126
+ readonly properties: z.ZodObject<{
127
+ previous_plan: z.ZodString;
128
+ plan: z.ZodString;
129
+ previous_has_growth_addon: z.ZodBoolean;
130
+ has_growth_addon: z.ZodBoolean;
131
+ is_downgrade: z.ZodBoolean;
132
+ is_scheduled: z.ZodBoolean;
133
+ }, z.core.$strip>;
134
+ };
135
+ readonly 'playground:playground_view': {
136
+ readonly surface: "web";
137
+ readonly insight: "How many accounts open the API Playground each week, and from where";
138
+ readonly fires: "When the Playground opens";
139
+ readonly properties: z.ZodObject<{
140
+ source: z.ZodEnum<{
141
+ function: "function";
142
+ connection: "connection";
143
+ integration: "integration";
144
+ }>;
145
+ }, z.core.$strip>;
146
+ };
147
+ readonly 'playground:run_start': {
148
+ readonly surface: "web";
149
+ readonly insight: "How many Playground runs accounts start, and on which functions";
150
+ readonly fires: "When someone runs a function in the Playground";
151
+ readonly properties: z.ZodObject<{
152
+ function_type: z.ZodString;
153
+ integration: z.ZodString;
154
+ is_run_again: z.ZodBoolean;
155
+ }, z.core.$strip>;
156
+ };
157
+ readonly 'playground:run_complete': {
158
+ readonly surface: "web";
159
+ readonly insight: "How often Playground runs succeed, and how long they take";
160
+ readonly fires: "When a Playground run returns a result or an error";
161
+ readonly properties: z.ZodObject<{
162
+ function_type: z.ZodString;
163
+ integration: z.ZodString;
164
+ is_success: z.ZodBoolean;
165
+ run_state: z.ZodString;
166
+ run_duration_ms: z.ZodNumber;
167
+ }, z.core.$strip>;
168
+ };
169
+ readonly 'playground:run_cancel': {
170
+ readonly surface: "web";
171
+ readonly insight: "How often people give up on a Playground run before it finishes";
172
+ readonly fires: "When someone cancels a running Playground run";
173
+ readonly properties: z.ZodObject<{
174
+ function_type: z.ZodString;
175
+ integration: z.ZodString;
176
+ }, z.core.$strip>;
177
+ };
178
+ readonly 'playground:approval_view': {
179
+ readonly surface: "web";
180
+ readonly insight: "How many changes the Agent Playground agent asks people to approve, and on which tools";
181
+ readonly fires: "When an Agent Playground reply finishes waiting for the user to approve a tool call";
182
+ readonly properties: z.ZodObject<{
183
+ chat_id: z.ZodString;
184
+ agent_session_id: z.ZodOptional<z.ZodString>;
185
+ tool_name: z.ZodString;
186
+ integration: z.ZodOptional<z.ZodString>;
187
+ http_method: z.ZodOptional<z.ZodString>;
188
+ }, z.core.$strip>;
189
+ };
190
+ readonly 'playground:approval_button_click': {
191
+ readonly surface: "web";
192
+ readonly insight: "How often people approve or deny the changes the Agent Playground agent asks for";
193
+ readonly fires: "When someone clicks Approve or Deny on a tool call in the Agent Playground";
194
+ readonly properties: z.ZodObject<{
195
+ is_approved: z.ZodBoolean;
196
+ chat_id: z.ZodString;
197
+ agent_session_id: z.ZodOptional<z.ZodString>;
198
+ tool_name: z.ZodString;
199
+ integration: z.ZodOptional<z.ZodString>;
200
+ http_method: z.ZodOptional<z.ZodString>;
201
+ }, z.core.$strip>;
202
+ };
203
+ readonly 'playground:integration_create': {
204
+ readonly surface: "server";
205
+ readonly insight: "How often an Agent Playground starter can't run because its integration can't be set up, and for which provider";
206
+ readonly fires: "When an Agent Playground starter creates its integration, reuses one, or can't set one up";
207
+ readonly properties: z.ZodUnion<readonly [z.ZodObject<{
208
+ provider: z.ZodString;
209
+ is_existing: z.ZodBoolean;
210
+ is_success: z.ZodLiteral<true>;
211
+ }, z.core.$strip>, z.ZodObject<{
212
+ provider: z.ZodString;
213
+ is_existing: z.ZodBoolean;
214
+ is_success: z.ZodLiteral<false>;
215
+ error_code: z.ZodType<"missing_credentials" | "not_created", unknown, z.core.$ZodTypeInternals<"missing_credentials" | "not_created", unknown>>;
216
+ }, z.core.$strip>]>;
217
+ };
218
+ readonly 'playground:agent_turn_complete': {
219
+ readonly surface: "server";
220
+ readonly insight: "What the Agent Playground costs per account, how often turns fail or get stopped, and whether first chats start from a starter";
221
+ readonly fires: "When an Agent Playground turn finishes, fails or is stopped";
222
+ readonly properties: z.ZodObject<{
223
+ agent_session_id: z.ZodString;
224
+ chat_id: z.ZodOptional<z.ZodString>;
225
+ environment_id: z.ZodNumber;
226
+ is_first_turn: z.ZodBoolean;
227
+ starter_provider: z.ZodOptional<z.ZodString>;
228
+ is_success: z.ZodBoolean;
229
+ error_code: z.ZodOptional<z.ZodString>;
230
+ is_stopped: z.ZodBoolean;
231
+ model: z.ZodOptional<z.ZodString>;
232
+ step_count: z.ZodNumber;
233
+ input_tokens: z.ZodNumber;
234
+ cache_read_tokens: z.ZodNumber;
235
+ cache_write_tokens: z.ZodNumber;
236
+ output_tokens: z.ZodNumber;
237
+ reasoning_tokens: z.ZodNumber;
238
+ cost_usd: z.ZodOptional<z.ZodNumber>;
239
+ }, z.core.$strip>;
240
+ };
241
+ readonly 'onboarding:connect_button_click': {
242
+ readonly surface: "web";
243
+ readonly insight: "How many accounts start the Getting Started flow by connecting GitHub";
244
+ readonly fires: "When someone clicks to connect GitHub on the Getting Started page";
245
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
246
+ };
247
+ readonly 'onboarding:connection_create': {
248
+ readonly surface: "web";
249
+ readonly insight: "How many accounts that start Getting Started get through the GitHub connect flow";
250
+ readonly fires: "When the GitHub connection on the Getting Started page is created";
251
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
252
+ };
253
+ readonly 'onboarding:run_complete': {
254
+ readonly surface: "web";
255
+ readonly insight: "How many accounts run the Getting Started code snippet, and how often it fails";
256
+ readonly fires: "When the Getting Started code snippet returns a result or an error";
257
+ readonly properties: z.ZodObject<{
258
+ is_success: z.ZodBoolean;
259
+ }, z.core.$strip>;
260
+ };
261
+ readonly 'onboarding:create_button_click': {
262
+ readonly surface: "web";
263
+ readonly insight: "How many accounts finish Getting Started and go on to set up their own integration";
264
+ readonly fires: "When someone clicks to set up their own integration at the end of Getting Started";
265
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
266
+ };
267
+ readonly 'connections:create_button_click': {
268
+ readonly surface: "web";
269
+ readonly insight: "How many people start creating a connection, and for which provider";
270
+ readonly fires: "When someone starts creating a connection from the dashboard or the Agent Playground";
271
+ readonly properties: z.ZodObject<{
272
+ provider: z.ZodString;
273
+ is_playground: z.ZodOptional<z.ZodBoolean>;
274
+ }, z.core.$strip>;
275
+ };
276
+ readonly 'connections:share_link_button_click': {
277
+ readonly surface: "web";
278
+ readonly insight: "How often people hand connection setup to an end user instead of doing it themselves";
279
+ readonly fires: "When someone copies a connect link to share";
280
+ readonly properties: z.ZodObject<{
281
+ provider: z.ZodString;
282
+ }, z.core.$strip>;
283
+ };
284
+ readonly 'connections:connection_create': {
285
+ readonly surface: "web";
286
+ readonly insight: "Which integrations fail most often during auth started from the dashboard or the Agent Playground";
287
+ readonly fires: "When a connect flow started from the dashboard or the Agent Playground finishes";
288
+ readonly properties: z.ZodUnion<readonly [z.ZodObject<{
289
+ provider: z.ZodString;
290
+ is_legacy_flow: z.ZodBoolean;
291
+ is_playground: z.ZodOptional<z.ZodBoolean>;
292
+ is_success: z.ZodLiteral<true>;
293
+ }, z.core.$strip>, z.ZodObject<{
294
+ provider: z.ZodString;
295
+ is_legacy_flow: z.ZodBoolean;
296
+ is_playground: z.ZodOptional<z.ZodBoolean>;
297
+ is_success: z.ZodLiteral<false>;
298
+ error_code: z.ZodString;
299
+ }, z.core.$strip>]>;
300
+ };
301
+ readonly 'connections:connection_delete': {
302
+ readonly surface: "server";
303
+ readonly insight: "How many accounts manage connections from the dashboard each week";
304
+ readonly fires: "After someone deletes a connection from the dashboard";
305
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
306
+ };
307
+ readonly 'integrations:integration_create': {
308
+ readonly surface: "server";
309
+ readonly insight: "How many accounts create integrations each week, from where, and whether they use Nango's developer app or fill in their own credentials";
310
+ readonly fires: "After an integration is created from the dashboard, the API, the management MCP or an Agent Playground starter";
311
+ readonly properties: z.ZodObject<{
312
+ provider: z.ZodString;
313
+ is_playground: z.ZodBoolean;
314
+ source: z.ZodEnum<{
315
+ api: "api";
316
+ mcp: "mcp";
317
+ playground: "playground";
318
+ dashboard: "dashboard";
319
+ }>;
320
+ is_shared_credentials: z.ZodBoolean;
321
+ has_missing_fields: z.ZodBoolean;
322
+ }, z.core.$strip>;
323
+ };
324
+ readonly 'integrations:filter_update': {
325
+ readonly surface: "web";
326
+ readonly insight: "How often people search their integrations list, and how often the search finds nothing";
327
+ readonly fires: "When someone stops typing in the integrations list search";
328
+ readonly properties: z.ZodObject<{
329
+ filter: z.ZodEnum<{
330
+ search: "search";
331
+ }>;
332
+ result_count: z.ZodNumber;
333
+ }, z.core.$strip>;
334
+ };
335
+ readonly 'integrations:create_page_view': {
336
+ readonly surface: "web";
337
+ readonly insight: "How many accounts open a provider's setup form, and how many leave it without creating an integration, split by whether Nango has a developer app for it";
338
+ readonly fires: "When a provider's create integration form loads";
339
+ readonly properties: z.ZodObject<{
340
+ provider: z.ZodString;
341
+ has_shared_credentials: z.ZodBoolean;
342
+ }, z.core.$strip>;
343
+ };
344
+ readonly 'integrations:integration_update': {
345
+ readonly surface: "server";
346
+ readonly insight: "How many accounts change integration settings from the dashboard each week";
347
+ readonly fires: "After someone saves an integration's settings in the dashboard";
348
+ readonly properties: z.ZodObject<{
349
+ provider: z.ZodString;
350
+ }, z.core.$strip>;
351
+ };
352
+ readonly 'integrations:integration_delete': {
353
+ readonly surface: "server";
354
+ readonly insight: "How many accounts delete integrations from the dashboard each week";
355
+ readonly fires: "After someone deletes an integration from the dashboard";
356
+ readonly properties: z.ZodObject<{
357
+ provider: z.ZodString;
358
+ }, z.core.$strip>;
359
+ };
360
+ readonly 'environments:environment_update': {
361
+ readonly surface: "server";
362
+ readonly insight: "How many accounts change environment settings each week, and which section";
363
+ readonly fires: "After someone saves environment settings, webhooks, variables or secret keys in the dashboard";
364
+ readonly properties: z.ZodObject<{
365
+ section: z.ZodEnum<{
366
+ webhooks: "webhooks";
367
+ settings: "settings";
368
+ variables: "variables";
369
+ api_keys: "api_keys";
370
+ }>;
371
+ }, z.core.$strip>;
372
+ };
373
+ readonly 'team:user_invite': {
374
+ readonly surface: "server";
375
+ readonly insight: "How many accounts invite teammates each week";
376
+ readonly fires: "After someone invites people to the account from the dashboard";
377
+ readonly properties: z.ZodObject<{
378
+ role: z.ZodString;
379
+ invite_count: z.ZodNumber;
380
+ }, z.core.$strip>;
381
+ };
382
+ readonly 'team:user_update': {
383
+ readonly surface: "server";
384
+ readonly insight: "How many accounts change their teammates' roles each week";
385
+ readonly fires: "After someone changes a teammate's role";
386
+ readonly properties: z.ZodObject<{
387
+ previous_role: z.ZodString;
388
+ role: z.ZodString;
389
+ }, z.core.$strip>;
390
+ };
391
+ readonly 'team:user_remove': {
392
+ readonly surface: "server";
393
+ readonly insight: "How many accounts remove teammates each week";
394
+ readonly fires: "After someone removes a teammate from the account";
395
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
396
+ };
397
+ readonly 'functions:sync_command_submit': {
398
+ readonly surface: "server";
399
+ readonly insight: "How many accounts run, pause or resume their connections' syncs from the dashboard each week";
400
+ readonly fires: "After the dashboard sends a command to a sync and the server accepts it";
401
+ readonly properties: z.ZodObject<{
402
+ command: z.ZodEnum<{
403
+ pause: "pause";
404
+ run: "run";
405
+ cancel: "cancel";
406
+ full_resync: "full_resync";
407
+ resume: "resume";
408
+ }>;
409
+ }, z.core.$strip>;
410
+ };
411
+ readonly 'functions:function_view': {
412
+ readonly surface: "web";
413
+ readonly insight: "How many accounts browse an integration's functions, and whether they look at catalog templates or functions they already deployed";
414
+ readonly fires: "When someone opens a function's details from the list on an integration's Functions tab";
415
+ readonly properties: z.ZodObject<{
416
+ provider: z.ZodString;
417
+ function_type: z.ZodString;
418
+ is_deployed: z.ZodBoolean;
419
+ }, z.core.$strip>;
420
+ };
421
+ readonly 'functions:deploy_create': {
422
+ readonly surface: "server";
423
+ readonly insight: "How many accounts deploy functions each week, from where, and whether they deploy templates or their own code";
424
+ readonly fires: "After the server accepts a function deployment from the CLI, the API, the dashboard or the management MCP";
425
+ readonly properties: z.ZodObject<{
426
+ source: z.ZodEnum<{
427
+ api: "api";
428
+ mcp: "mcp";
429
+ cli: "cli";
430
+ dashboard: "dashboard";
431
+ }>;
432
+ is_template: z.ZodBoolean;
433
+ function_count: z.ZodNumber;
434
+ }, z.core.$strip>;
435
+ };
436
+ readonly 'logs:filter_update': {
437
+ readonly surface: "web";
438
+ readonly insight: "How many accounts search or filter their logs each week, and with which filter";
439
+ readonly fires: "When someone searches the logs or changes a logs filter";
440
+ readonly properties: z.ZodObject<{
441
+ filter: z.ZodEnum<{
442
+ type: "type";
443
+ connection: "connection";
444
+ integration: "integration";
445
+ agent_session: "agent_session";
446
+ search: "search";
447
+ script: "script";
448
+ status: "status";
449
+ period: "period";
450
+ }>;
451
+ }, z.core.$strip>;
452
+ };
453
+ readonly 'logs:operation_view': {
454
+ readonly surface: "web";
455
+ readonly insight: "How many accounts open a log operation each week";
456
+ readonly fires: "When someone opens an operation from the logs list";
457
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
458
+ };
459
+ readonly 'auth:account_create': {
460
+ readonly surface: "server";
461
+ readonly insight: "Weekly signups and first website sources. Permitted advertising_* fields feed ad-platform conversion destinations.";
462
+ readonly fires: "After a signup creates a new account, whichever way the person signed up";
463
+ readonly properties: z.ZodObject<{
464
+ acquisition_utm_source: z.ZodOptional<z.ZodString>;
465
+ acquisition_utm_medium: z.ZodOptional<z.ZodString>;
466
+ acquisition_utm_campaign: z.ZodOptional<z.ZodString>;
467
+ acquisition_utm_content: z.ZodOptional<z.ZodString>;
468
+ acquisition_utm_term: z.ZodOptional<z.ZodString>;
469
+ acquisition_referring_domain: z.ZodOptional<z.ZodString>;
470
+ acquisition_landing_path: z.ZodOptional<z.ZodString>;
471
+ advertising_consent_method: z.ZodOptional<z.ZodEnum<{
472
+ explicit: "explicit";
473
+ implied: "implied";
474
+ }>>;
475
+ advertising_consent_timestamp: z.ZodOptional<z.ZodString>;
476
+ advertising_oppref_click_timestamp: z.ZodOptional<z.ZodString>;
477
+ advertising_fbc: z.ZodOptional<z.ZodString>;
478
+ advertising_oppref: z.ZodOptional<z.ZodString>;
479
+ }, z.core.$strip>;
480
+ };
481
+ readonly 'auth:user_create': {
482
+ readonly surface: "server";
483
+ readonly insight: "How many users join each week, and how: password or Google, new account or invite";
484
+ readonly fires: "After a user is created, including users who join through an invite";
485
+ readonly properties: z.ZodObject<{
486
+ method: z.ZodEnum<{
487
+ password: "password";
488
+ google: "google";
489
+ }>;
490
+ }, z.core.$strip>;
491
+ };
492
+ readonly 'auth:join_request_submit': {
493
+ readonly surface: "web";
494
+ readonly insight: "How many new users ask to join an existing account instead of creating their own";
495
+ readonly fires: "When someone asks to join an account found for their email domain";
496
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
497
+ };
498
+ readonly 'auth:two_factor_start': {
499
+ readonly surface: "web";
500
+ readonly insight: "How many users start setting up two-factor authentication";
501
+ readonly fires: "When someone starts setting up two-factor authentication";
502
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
503
+ };
504
+ readonly 'auth:two_factor_complete': {
505
+ readonly surface: "web";
506
+ readonly insight: "How many users finish two-factor enrolment, and why the code check fails";
507
+ readonly fires: "When the two-factor code is checked at the end of enrolment";
508
+ readonly properties: z.ZodUnion<readonly [z.ZodObject<{
509
+ is_success: z.ZodLiteral<true>;
510
+ }, z.core.$strip>, z.ZodObject<{
511
+ is_success: z.ZodLiteral<false>;
512
+ error_code: z.ZodString;
513
+ }, z.core.$strip>]>;
514
+ };
515
+ readonly 'auth:two_factor_cancel': {
516
+ readonly surface: "web";
517
+ readonly insight: "At which step people abandon two-factor enrolment";
518
+ readonly fires: "When someone closes two-factor enrolment before finishing";
519
+ readonly properties: z.ZodObject<{
520
+ step: z.ZodEnum<{
521
+ scan: "scan";
522
+ save: "save";
523
+ }>;
524
+ }, z.core.$strip>;
525
+ };
526
+ readonly 'auth:two_factor_remove': {
527
+ readonly surface: "web";
528
+ readonly insight: "How many users turn two-factor authentication off again";
529
+ readonly fires: "After two-factor authentication is turned off";
530
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
531
+ };
532
+ readonly 'auth:recovery_codes_generate': {
533
+ readonly surface: "web";
534
+ readonly insight: "How often users replace their two-factor recovery codes";
535
+ readonly fires: "After new recovery codes are generated";
536
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
537
+ };
538
+ readonly 'auth:download_button_click': {
539
+ readonly surface: "web";
540
+ readonly insight: "Whether users save their recovery codes by downloading them";
541
+ readonly fires: "When someone downloads their recovery codes";
542
+ readonly properties: z.ZodObject<{
543
+ flow: z.ZodEnum<{
544
+ enroll: "enroll";
545
+ regenerate: "regenerate";
546
+ }>;
547
+ }, z.core.$strip>;
548
+ };
549
+ readonly 'auth:copy_button_click': {
550
+ readonly surface: "web";
551
+ readonly insight: "Whether users save the secrets the dashboard shows only once: recovery codes and new API keys";
552
+ readonly fires: "When someone copies recovery codes or a new API key secret";
553
+ readonly properties: z.ZodUnion<readonly [z.ZodObject<{
554
+ copied_item: z.ZodLiteral<"recovery_codes">;
555
+ flow: z.ZodEnum<{
556
+ enroll: "enroll";
557
+ regenerate: "regenerate";
558
+ }>;
559
+ }, z.core.$strip>, z.ZodObject<{
560
+ copied_item: z.ZodLiteral<"api_key_secret">;
561
+ }, z.core.$strip>]>;
562
+ };
563
+ readonly 'auth:password_update': {
564
+ readonly surface: "web";
565
+ readonly insight: "How often users change their password";
566
+ readonly fires: "After a password change is saved";
567
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
568
+ };
569
+ readonly 'auth:api_keys_link_click': {
570
+ readonly surface: "web";
571
+ readonly insight: "How people find account API keys";
572
+ readonly fires: "When someone opens API keys from the profile menu";
573
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
574
+ };
575
+ readonly 'auth:api_key_create': {
576
+ readonly surface: "web";
577
+ readonly insight: "How many accounts create account API keys";
578
+ readonly fires: "After an account API key is created";
579
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
580
+ };
581
+ readonly 'auth:api_key_delete': {
582
+ readonly surface: "web";
583
+ readonly insight: "How often account API keys are deleted, as a sign they get rotated";
584
+ readonly fires: "After an account API key is deleted";
585
+ readonly properties: z.ZodRecord<z.ZodString, z.ZodNever>;
586
+ };
587
+ readonly 'audit:export_complete': {
588
+ readonly surface: "web";
589
+ readonly insight: "How many accounts export their audit trail, and how often exports hit the row limit";
590
+ readonly fires: "When an audit trail export finishes or fails";
591
+ readonly properties: z.ZodUnion<readonly [z.ZodObject<{
592
+ is_success: z.ZodLiteral<true>;
593
+ is_truncated: z.ZodBoolean;
594
+ }, z.core.$strip>, z.ZodObject<{
595
+ is_success: z.ZodLiteral<false>;
596
+ error_code: z.ZodString;
597
+ }, z.core.$strip>]>;
598
+ };
599
+ readonly 'functions:command_start': {
600
+ readonly surface: "cli";
601
+ readonly insight: "Which CLI commands do people run, and how often?";
602
+ readonly fires: "Before a CLI command runs";
603
+ readonly properties: z.ZodObject<{
604
+ command: z.ZodType<CliTelemetryCommand, unknown, z.core.$ZodTypeInternals<CliTelemetryCommand, unknown>>;
605
+ is_device_ephemeral: z.ZodOptional<z.ZodBoolean>;
606
+ }, z.core.$strip>;
607
+ };
608
+ readonly 'agents:session_start': {
609
+ readonly surface: "server";
610
+ readonly insight: "How many accounts create agent sessions each week, and which meta tools they turn on";
611
+ readonly fires: "After an agent session is created";
612
+ readonly properties: z.ZodObject<{
613
+ integration_count: z.ZodNumber;
614
+ is_tool_search_enabled: z.ZodBoolean;
615
+ is_execute_enabled: z.ZodBoolean;
616
+ is_proxy_enabled: z.ZodBoolean;
617
+ is_create_connection_enabled: z.ZodBoolean;
618
+ agent_session_id: z.ZodString;
619
+ is_playground: z.ZodBoolean;
620
+ }, z.core.$strip>;
621
+ };
622
+ readonly 'agents:session_end': {
623
+ readonly surface: "server";
624
+ readonly insight: "How long do agent sessions last?";
625
+ readonly fires: "After an agent session is terminated. Expired sessions send nothing";
626
+ readonly properties: z.ZodObject<{
627
+ session_duration_ms: z.ZodNumber;
628
+ agent_session_id: z.ZodString;
629
+ is_playground: z.ZodBoolean;
630
+ }, z.core.$strip>;
631
+ };
632
+ readonly 'agents:tool_call_complete': {
633
+ readonly surface: "server";
634
+ readonly insight: "Which tools do agents call most, and which fail most often?";
635
+ readonly fires: "When a tool call in an agent session returns";
636
+ readonly properties: z.ZodObject<{
637
+ tool_name: z.ZodOptional<z.ZodString>;
638
+ meta_tool: z.ZodOptional<z.ZodType<AgentSessionMetaTool, unknown, z.core.$ZodTypeInternals<AgentSessionMetaTool, unknown>>>;
639
+ is_pinned: z.ZodOptional<z.ZodBoolean>;
640
+ integration_id: z.ZodOptional<z.ZodString>;
641
+ underlying_error_code: z.ZodOptional<z.ZodString>;
642
+ is_mcp_tool: z.ZodOptional<z.ZodBoolean>;
643
+ is_success: z.ZodBoolean;
644
+ log_operation_id: z.ZodOptional<z.ZodString>;
645
+ error_code: z.ZodOptional<z.ZodString>;
646
+ agent_session_id: z.ZodString;
647
+ is_playground: z.ZodBoolean;
648
+ }, z.core.$strip>;
649
+ };
650
+ readonly 'agents:proxy_request_complete': {
651
+ readonly surface: "server";
652
+ readonly insight: "Which integration APIs agents call through the proxy, and how often those requests fail";
653
+ readonly fires: "When a proxy request from an agent session returns";
654
+ readonly properties: z.ZodObject<{
655
+ integration_id: z.ZodOptional<z.ZodString>;
656
+ http_method: z.ZodOptional<z.ZodType<HTTP_METHOD, unknown, z.core.$ZodTypeInternals<HTTP_METHOD, unknown>>>;
657
+ provider: z.ZodOptional<z.ZodString>;
658
+ http_status: z.ZodOptional<z.ZodNumber>;
659
+ provider_error_code: z.ZodOptional<z.ZodString>;
660
+ is_success: z.ZodBoolean;
661
+ log_operation_id: z.ZodOptional<z.ZodString>;
662
+ error_code: z.ZodOptional<z.ZodString>;
663
+ meta_tool: z.ZodLiteral<"nango_proxy">;
664
+ agent_session_id: z.ZodString;
665
+ is_playground: z.ZodBoolean;
666
+ }, z.core.$strip>;
667
+ };
668
+ readonly 'agents:tool_search_complete': {
669
+ readonly surface: "server";
670
+ readonly insight: "How often does tool search return a tool the agent then uses?";
671
+ readonly fires: "When a tool search in an agent session returns";
672
+ readonly properties: z.ZodObject<{
673
+ query: z.ZodOptional<z.ZodString>;
674
+ match_count: z.ZodNumber;
675
+ related_count: z.ZodNumber;
676
+ top_match_confidence: z.ZodOptional<z.ZodNumber>;
677
+ matches: z.ZodArray<z.ZodCustom<AgentSessionToolSearchHit, AgentSessionToolSearchHit>>;
678
+ related: z.ZodArray<z.ZodCustom<AgentSessionToolSearchHit, AgentSessionToolSearchHit>>;
679
+ is_success: z.ZodBoolean;
680
+ log_operation_id: z.ZodOptional<z.ZodString>;
681
+ error_code: z.ZodOptional<z.ZodString>;
682
+ meta_tool: z.ZodLiteral<"nango_tool_search">;
683
+ agent_session_id: z.ZodString;
684
+ is_playground: z.ZodBoolean;
685
+ }, z.core.$strip>;
686
+ };
687
+ };
688
+ type AnalyticsEventCatalogue = typeof analyticsEventCatalogue;
689
+ type AnalyticsEventKey = keyof AnalyticsEventCatalogue;
690
+ export type AnalyticsEventNameFor<S extends AnalyticsSurface> = {
691
+ [E in AnalyticsEventKey]: S extends AnalyticsEventCatalogue[E]['surface'] ? E : never;
692
+ }[AnalyticsEventKey];
693
+ export type AnalyticsEventProperties<E extends AnalyticsEventKey> = z.infer<AnalyticsEventCatalogue[E]['properties']>;
694
+ export type AnalyticsEventPropertiesInput<E extends AnalyticsEventKey> = Record<never, never> extends AnalyticsEventProperties<E> ? {
695
+ eventProperties?: AnalyticsEventProperties<E>;
696
+ } : {
697
+ eventProperties: AnalyticsEventProperties<E>;
698
+ };
699
+ export type AnalyticsEventPropertiesArgs<E extends AnalyticsEventKey> = Record<never, never> extends AnalyticsEventProperties<E> ? [properties?: AnalyticsEventProperties<E>] : [properties: AnalyticsEventProperties<E>];
700
+ export {};