@entrolytics/api-client 2.2.0 → 2.2.2

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.
package/dist/index.d.ts DELETED
@@ -1,1932 +0,0 @@
1
- import { CliAccessTokenMetadata } from '@entrolytics/shared';
2
- export { API_ENDPOINTS, API_ROUTES, BILLING_ERRORS, CLI_CONFIG, CLI_TOKEN_STATUS, DEFAULT_API_HOST, DEPLOYMENT_ENV_VARS, DEPLOYMENT_SOURCES, ENV_VAR_NAMES, ERROR_MESSAGES, EVENT_TYPES, FORM_EVENT_TYPES, FORM_FIELD_TYPES, FRAMEWORK_PACKAGES, FRAMEWORK_PATTERNS, HTTP_STATUS, NAVIGATION_TYPES, ONBOARDING_STEPS, PLANS, PLAN_FEATURES, RATE_LIMITS, SUCCESS_MESSAGES, USAGE_THRESHOLDS, USER_ROLES, VITAL_RATINGS, VITAL_THRESHOLDS, VITAL_TYPES, detectDeploymentContext, getApiRoute, getEnvVarNames, getFrameworkPackage, getPlan, getPlanLimit, getVitalRating, isPlanFeatureEnabled, isUsageCritical, isUsageWarning, isValidFramework } from '@entrolytics/shared';
3
-
4
- interface ApiResponse<T> {
5
- ok: boolean;
6
- status: number;
7
- data?: T;
8
- error?: string;
9
- }
10
- interface PaginationParams {
11
- page?: number;
12
- pageSize?: number;
13
- orderBy?: string;
14
- }
15
- interface DateRangeParams {
16
- startAt: number;
17
- endAt: number;
18
- [key: string]: string | number | boolean | undefined;
19
- }
20
- type PlatformRole = 'admin' | 'user' | 'view-only';
21
- type OrganizationRole = 'admin' | 'manager' | 'member' | 'view-only';
22
- interface User {
23
- id: string;
24
- /** Clerk user ID (user_xxx format) */
25
- clerkId: string;
26
- /** Primary email address */
27
- email: string;
28
- /** Display name (computed from firstName + lastName or email) */
29
- displayName: string;
30
- /** First name from Clerk */
31
- firstName?: string | null;
32
- /** Last name from Clerk */
33
- lastName?: string | null;
34
- /** Profile image URL */
35
- imageUrl?: string | null;
36
- /** Platform-level role */
37
- role: PlatformRole;
38
- /** Whether user has admin privileges */
39
- isAdmin: boolean;
40
- /** Current organization ID (if in org context) */
41
- orgId?: string | null;
42
- /** Role within current organization */
43
- orgRole?: OrganizationRole | null;
44
- createdAt: string;
45
- updatedAt?: string | null;
46
- /** @deprecated Use clerkId instead */
47
- username?: string;
48
- }
49
- interface CreateUserData {
50
- email: string;
51
- firstName?: string;
52
- lastName?: string;
53
- role?: PlatformRole;
54
- }
55
- interface UpdateUserData {
56
- firstName?: string;
57
- lastName?: string;
58
- role?: PlatformRole;
59
- }
60
- interface Organization {
61
- id: string;
62
- name: string;
63
- createdAt: string;
64
- }
65
- interface CreateOrgData {
66
- name: string;
67
- }
68
- interface UpdateOrgData {
69
- name?: string;
70
- }
71
- interface OrgUser {
72
- id: string;
73
- userId: string;
74
- orgId: string;
75
- role: OrganizationRole;
76
- user: User;
77
- createdAt: string;
78
- }
79
- interface JoinOrgData {
80
- accessCode: string;
81
- }
82
- interface Website {
83
- id: string;
84
- name: string;
85
- domain: string;
86
- shareId?: string;
87
- resetAt?: string;
88
- userId?: string;
89
- orgId?: string;
90
- createdAt: string;
91
- deletedAt?: string;
92
- }
93
- interface CreateWebsiteData {
94
- name: string;
95
- domain: string;
96
- shareId?: string;
97
- orgId?: string;
98
- }
99
- interface UpdateWebsiteData {
100
- name?: string;
101
- domain?: string;
102
- shareId?: string;
103
- }
104
- interface WebsiteStats {
105
- pageviews: {
106
- value: number;
107
- change: number;
108
- };
109
- visitors: {
110
- value: number;
111
- change: number;
112
- };
113
- visits: {
114
- value: number;
115
- change: number;
116
- };
117
- bounces: {
118
- value: number;
119
- change: number;
120
- };
121
- totalTime: {
122
- value: number;
123
- change: number;
124
- };
125
- }
126
- /**
127
- * Link statistics - alias to WebsiteStats as they share the same structure
128
- */
129
- type LinkStats = WebsiteStats;
130
- /**
131
- * @deprecated Use WebsiteStats or LinkStats instead
132
- */
133
- type Stats = WebsiteStats;
134
- interface PageviewData {
135
- x: string;
136
- y: number;
137
- }
138
- interface WebsitePageviews {
139
- pageviews: PageviewData[];
140
- sessions: PageviewData[];
141
- }
142
- interface MetricData {
143
- x: string;
144
- y: number;
145
- }
146
- type MetricType = 'url' | 'title' | 'referrer' | 'browser' | 'os' | 'device' | 'country' | 'region' | 'city' | 'language' | 'event';
147
- interface WebsiteMetricsParams extends DateRangeParams {
148
- type: MetricType;
149
- url?: string;
150
- referrer?: string;
151
- title?: string;
152
- query?: string;
153
- event?: string;
154
- limit?: number;
155
- offset?: number;
156
- [key: string]: string | number | boolean | undefined;
157
- }
158
- interface WebsiteEvent {
159
- id: string;
160
- websiteId: string;
161
- sessionId: string;
162
- createdAt: string;
163
- urlPath: string;
164
- urlQuery?: string;
165
- referrerPath?: string;
166
- referrerQuery?: string;
167
- referrerDomain?: string;
168
- pageTitle?: string;
169
- eventType: number;
170
- eventName?: string;
171
- }
172
- interface EventStats {
173
- events: number;
174
- fields: number;
175
- }
176
- interface EventData {
177
- eventName: string;
178
- propertyName: string;
179
- dataType: number;
180
- total: number;
181
- }
182
- interface EventDataField {
183
- fieldName: string;
184
- dataType: number;
185
- fieldValue?: string;
186
- }
187
- interface Session {
188
- id: string;
189
- websiteId: string;
190
- hostname: string;
191
- browser: string;
192
- os: string;
193
- device: string;
194
- screen: string;
195
- language: string;
196
- country?: string;
197
- subdivision1?: string;
198
- subdivision2?: string;
199
- city?: string;
200
- createdAt: string;
201
- distinctId?: string;
202
- }
203
- interface SessionStats {
204
- pageviews: number;
205
- visitors: number;
206
- visits: number;
207
- countries: number;
208
- }
209
- interface SessionActivity {
210
- createdAt: string;
211
- urlPath: string;
212
- urlQuery?: string;
213
- referrerDomain?: string;
214
- referrerPath?: string;
215
- eventName?: string;
216
- eventType: number;
217
- }
218
- interface Report {
219
- id: string;
220
- userId: string;
221
- websiteId: string;
222
- type: string;
223
- name: string;
224
- description?: string;
225
- parameters: string;
226
- createdAt: string;
227
- updatedAt: string;
228
- }
229
- interface CreateReportData {
230
- websiteId: string;
231
- type: string;
232
- name: string;
233
- description?: string;
234
- parameters: Record<string, unknown>;
235
- }
236
- interface UpdateReportData {
237
- name?: string;
238
- description?: string;
239
- parameters?: Record<string, unknown>;
240
- }
241
- interface Segment {
242
- id: string;
243
- websiteId: string;
244
- name: string;
245
- data: string;
246
- createdAt: string;
247
- updatedAt: string;
248
- }
249
- interface CreateSegmentData {
250
- name: string;
251
- data: Record<string, unknown>;
252
- }
253
- interface UpdateSegmentData {
254
- name?: string;
255
- data?: Record<string, unknown>;
256
- }
257
- interface Link {
258
- id: string;
259
- orgId: string;
260
- name: string;
261
- url: string;
262
- shortUrl: string;
263
- clicks: number;
264
- createdAt: string;
265
- }
266
- interface CreateLinkData {
267
- name: string;
268
- url: string;
269
- shortUrl?: string;
270
- }
271
- interface UpdateLinkData {
272
- name?: string;
273
- url?: string;
274
- }
275
- interface Pixel {
276
- id: string;
277
- orgId: string;
278
- name: string;
279
- trackingId: string;
280
- impressions: number;
281
- createdAt: string;
282
- }
283
- interface CreatePixelData {
284
- name: string;
285
- }
286
- interface UpdatePixelData {
287
- name?: string;
288
- }
289
- interface RealtimeData {
290
- pageviews: PageviewData[];
291
- sessions: PageviewData[];
292
- events: EventData[];
293
- timestamp: number;
294
- }
295
- interface ActiveVisitor {
296
- x: string;
297
- y: number;
298
- }
299
- interface Board {
300
- id: string;
301
- userId: string;
302
- orgId?: string;
303
- websiteId: string;
304
- name: string;
305
- description?: string;
306
- createdAt: string;
307
- updatedAt: string;
308
- }
309
- interface BoardWidget {
310
- id: string;
311
- boardId: string;
312
- title: string;
313
- type: string;
314
- parameters: Record<string, unknown>;
315
- position: {
316
- x: number;
317
- y: number;
318
- w: number;
319
- h: number;
320
- };
321
- createdAt: string;
322
- updatedAt: string;
323
- }
324
- interface CreateBoardData {
325
- websiteId: string;
326
- name: string;
327
- description?: string;
328
- }
329
- interface UpdateBoardData {
330
- name?: string;
331
- description?: string;
332
- }
333
- interface CreateBoardWidgetData {
334
- title: string;
335
- type: string;
336
- parameters?: Record<string, unknown>;
337
- position?: {
338
- x: number;
339
- y: number;
340
- w: number;
341
- h: number;
342
- };
343
- }
344
- interface UpdateBoardWidgetData {
345
- title?: string;
346
- type?: string;
347
- parameters?: Record<string, unknown>;
348
- position?: {
349
- x: number;
350
- y: number;
351
- w: number;
352
- h: number;
353
- };
354
- }
355
- type PlanId = 'starter' | 'pro' | 'business' | 'enterprise';
356
- interface AccountUsage {
357
- /** Current billing period start date (ISO string) */
358
- periodStart: string;
359
- /** Current billing period end date (ISO string) */
360
- periodEnd: string;
361
- /** Number of pageviews recorded this period */
362
- pageviews: number;
363
- /** Number of custom events recorded this period */
364
- events: number;
365
- /** Number of websites currently active */
366
- websites: number;
367
- /** Number of team members (for org accounts) */
368
- teamMembers: number;
369
- }
370
- interface AccountEntitlements {
371
- /** User's current plan */
372
- plan: PlanId;
373
- /** Maximum pageviews per month */
374
- maxPageviews: number;
375
- /** Maximum custom events per month */
376
- maxEvents: number;
377
- /** Maximum websites allowed */
378
- maxWebsites: number;
379
- /** Maximum team members allowed */
380
- maxTeamMembers: number;
381
- /** Data retention period in months */
382
- dataRetentionMonths: number;
383
- /** Feature flags */
384
- features: {
385
- customDomains: boolean;
386
- apiAccess: boolean;
387
- webhooks: boolean;
388
- advancedReports: boolean;
389
- exportData: boolean;
390
- whiteLabel: boolean;
391
- prioritySupport: boolean;
392
- sla: boolean;
393
- };
394
- }
395
- interface Subscription {
396
- /** Subscription ID */
397
- id: string;
398
- /** Current plan */
399
- plan: PlanId;
400
- /** Subscription status */
401
- status: 'active' | 'past_due' | 'canceled' | 'trialing' | 'incomplete';
402
- /** Current billing period start */
403
- currentPeriodStart: string;
404
- /** Current billing period end */
405
- currentPeriodEnd: string;
406
- /** Whether subscription will cancel at period end */
407
- cancelAtPeriodEnd: boolean;
408
- /** Trial end date (if trialing) */
409
- trialEnd?: string;
410
- }
411
- interface CheckoutOptions {
412
- /** Plan to checkout */
413
- plan: PlanId;
414
- /** Billing interval */
415
- interval?: 'month' | 'year';
416
- /** Success redirect URL */
417
- successUrl?: string;
418
- /** Cancel redirect URL */
419
- cancelUrl?: string;
420
- }
421
- interface CheckoutResponse {
422
- /** Stripe checkout URL */
423
- url: string;
424
- }
425
- interface PortalResponse {
426
- /** Stripe customer portal URL */
427
- url: string;
428
- }
429
- /**
430
- * Website ingest mode configuration
431
- */
432
- type IngestMode = 'auto' | 'node' | 'edge';
433
- interface WebsiteModeConfig {
434
- ingestMode: IngestMode;
435
- }
436
- /**
437
- * Routing health status
438
- */
439
- interface RoutingHealth {
440
- status: 'ok' | 'degraded' | 'error';
441
- edge: {
442
- healthy: boolean;
443
- latency: number;
444
- };
445
- node: {
446
- healthy: boolean;
447
- latency: number;
448
- };
449
- timestamp: string;
450
- }
451
- /**
452
- * Routing statistics
453
- */
454
- interface RoutingStats {
455
- period: {
456
- start: string;
457
- end: string;
458
- };
459
- requests: {
460
- total: number;
461
- edge: number;
462
- node: number;
463
- };
464
- latency: {
465
- edge: {
466
- p50: number;
467
- p95: number;
468
- p99: number;
469
- };
470
- node: {
471
- p50: number;
472
- p95: number;
473
- p99: number;
474
- };
475
- };
476
- }
477
- type VitalMetric = 'LCP' | 'INP' | 'CLS' | 'TTFB' | 'FCP';
478
- type VitalRating = 'good' | 'needs-improvement' | 'poor';
479
- type NavigationType = 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender' | 'restore';
480
- interface WebVital {
481
- id: string;
482
- websiteId: string;
483
- sessionId?: string;
484
- createdAt: string;
485
- metricName: VitalMetric;
486
- metricValue: number;
487
- metricRating: VitalRating;
488
- urlPath: string;
489
- deviceType?: string;
490
- connectionType?: string;
491
- deployId?: string;
492
- navigationType?: NavigationType;
493
- }
494
- interface WebVitalsStats {
495
- metric: VitalMetric;
496
- count: number;
497
- p50: number;
498
- p75: number;
499
- p95: number;
500
- good: number;
501
- needsImprovement: number;
502
- poor: number;
503
- }
504
- interface WebVitalsParams extends DateRangeParams {
505
- metric?: VitalMetric;
506
- urlPath?: string;
507
- deployId?: string;
508
- deviceType?: string;
509
- }
510
- interface TrackVitalData {
511
- metric: VitalMetric;
512
- value: number;
513
- rating: VitalRating;
514
- delta?: number;
515
- id?: string;
516
- navigationType?: NavigationType;
517
- attribution?: Record<string, unknown>;
518
- url?: string;
519
- path?: string;
520
- sessionId?: string;
521
- }
522
- type FormEventType = 'start' | 'field_focus' | 'field_blur' | 'field_error' | 'submit' | 'abandon';
523
- interface FormEvent {
524
- id: string;
525
- websiteId: string;
526
- sessionId?: string;
527
- createdAt: string;
528
- formId: string;
529
- formName?: string;
530
- eventType: FormEventType;
531
- fieldName?: string;
532
- fieldType?: string;
533
- fieldIndex?: number;
534
- timeOnField?: number;
535
- timeSinceStart?: number;
536
- errorMessage?: string;
537
- success?: boolean;
538
- urlPath: string;
539
- }
540
- interface FormStats {
541
- formId: string;
542
- formName?: string;
543
- starts: number;
544
- submissions: number;
545
- abandonments: number;
546
- conversionRate: number;
547
- avgTimeToComplete: number;
548
- }
549
- interface FormFieldStats {
550
- fieldName: string;
551
- fieldType?: string;
552
- focusCount: number;
553
- blurCount: number;
554
- errorCount: number;
555
- avgTimeOnField: number;
556
- dropOffRate: number;
557
- }
558
- interface FormAnalyticsParams extends DateRangeParams {
559
- formId?: string;
560
- urlPath?: string;
561
- }
562
- interface TrackFormEventData {
563
- eventType: FormEventType;
564
- formId: string;
565
- formName?: string;
566
- urlPath: string;
567
- fieldName?: string;
568
- fieldType?: string;
569
- fieldIndex?: number;
570
- timeOnField?: number;
571
- timeSinceStart?: number;
572
- errorMessage?: string;
573
- success?: boolean;
574
- sessionId?: string;
575
- }
576
- interface Deployment {
577
- id: string;
578
- websiteId: string;
579
- deployId: string;
580
- gitSha?: string;
581
- gitBranch?: string;
582
- deployUrl?: string;
583
- firstSeenAt: string;
584
- lastSeenAt: string;
585
- totalSessions: number;
586
- totalPageviews: number;
587
- avgLcp?: number;
588
- avgInp?: number;
589
- avgCls?: number;
590
- avgTtfb?: number;
591
- avgFcp?: number;
592
- }
593
- interface DeploymentComparison {
594
- current: Deployment;
595
- previous?: Deployment;
596
- diff: {
597
- sessions: number;
598
- pageviews: number;
599
- lcp?: number;
600
- inp?: number;
601
- cls?: number;
602
- ttfb?: number;
603
- fcp?: number;
604
- };
605
- }
606
- interface DeploymentParams extends DateRangeParams {
607
- deployId?: string;
608
- gitBranch?: string;
609
- limit?: number;
610
- }
611
- interface SetDeploymentData {
612
- deployId: string;
613
- gitSha?: string;
614
- gitBranch?: string;
615
- deployUrl?: string;
616
- source?: 'vercel' | 'netlify' | 'cloudflare' | 'railway' | 'render' | 'fly' | 'heroku' | 'aws' | 'gcp' | 'azure' | 'custom';
617
- }
618
-
619
- interface ClientConfig {
620
- /** API endpoint URL (e.g., 'https://analytics.example.com/api') */
621
- endpoint?: string;
622
- /** Bearer token for Clerk-authenticated requests */
623
- bearerToken?: string;
624
- /** API key for programmatic access */
625
- apiKey?: string;
626
- /** User ID for self-hosted authentication (legacy) */
627
- userId?: string;
628
- /** Secret for self-hosted authentication (legacy) */
629
- secret?: string;
630
- /** Custom fetch implementation */
631
- fetch?: typeof fetch;
632
- /** Number of retry attempts for failed requests (default: 3) */
633
- retries?: number;
634
- /** Base delay between retries in ms (default: 1000) */
635
- retryDelay?: number;
636
- }
637
- type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
638
- interface RequestOptions {
639
- method?: HttpMethod;
640
- body?: unknown;
641
- params?: Record<string, string | number | boolean | undefined>;
642
- headers?: Record<string, string>;
643
- }
644
- /**
645
- * Core API client for making authenticated requests.
646
- */
647
- declare class ApiClient {
648
- private endpoint;
649
- private bearerToken?;
650
- private apiKey?;
651
- private userId?;
652
- private secret?;
653
- private fetchFn;
654
- private retries;
655
- private retryDelay;
656
- constructor(config?: ClientConfig);
657
- /**
658
- * Update the bearer token (useful for token refresh).
659
- */
660
- setBearerToken(token: string): void;
661
- /**
662
- * Generate authentication headers.
663
- * Priority: Bearer token > API key > Legacy share token
664
- */
665
- private getAuthHeaders;
666
- /**
667
- * Create a share token for self-hosted authentication (legacy).
668
- * @deprecated Use bearerToken or apiKey instead
669
- */
670
- private createShareToken;
671
- /**
672
- * Sleep helper for retry delays.
673
- */
674
- private sleep;
675
- /**
676
- * Check if error is retryable.
677
- */
678
- private isRetryable;
679
- /**
680
- * Build URL with query parameters.
681
- */
682
- private buildUrl;
683
- /**
684
- * Make an authenticated API request with automatic retries.
685
- */
686
- request<T>(path: string, options?: RequestOptions): Promise<ApiResponse<T>>;
687
- /**
688
- * GET request helper.
689
- */
690
- get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<ApiResponse<T>>;
691
- /**
692
- * POST request helper.
693
- */
694
- post<T>(path: string, body?: unknown): Promise<ApiResponse<T>>;
695
- /**
696
- * PUT request helper.
697
- */
698
- put<T>(path: string, body?: unknown): Promise<ApiResponse<T>>;
699
- /**
700
- * DELETE request helper.
701
- */
702
- delete<T>(path: string): Promise<ApiResponse<T>>;
703
- /**
704
- * PATCH request helper.
705
- */
706
- patch<T>(path: string, body?: unknown): Promise<ApiResponse<T>>;
707
- }
708
-
709
- interface AdminOrgParams {
710
- orgId: string;
711
- }
712
- interface AdminUserParams {
713
- userId: string;
714
- }
715
- interface AdminWebsiteParams {
716
- websiteId: string;
717
- }
718
- declare function createAdminEndpoints(client: ApiClient): {
719
- /**
720
- * Get all organizations (admin only)
721
- */
722
- getOrgs: () => Promise<ApiResponse<unknown>>;
723
- /**
724
- * Get organization details (admin only)
725
- */
726
- getOrg: ({ orgId }: AdminOrgParams) => Promise<ApiResponse<unknown>>;
727
- /**
728
- * Get all users (admin only)
729
- */
730
- getUsers: () => Promise<ApiResponse<unknown>>;
731
- /**
732
- * Get user details (admin only)
733
- */
734
- getUser: ({ userId }: AdminUserParams) => Promise<ApiResponse<unknown>>;
735
- /**
736
- * Get all websites (admin only)
737
- */
738
- getWebsites: () => Promise<ApiResponse<unknown>>;
739
- /**
740
- * Get website details (admin only)
741
- */
742
- getWebsite: ({ websiteId }: AdminWebsiteParams) => Promise<ApiResponse<unknown>>;
743
- /**
744
- * Run admin setup
745
- */
746
- setup: () => Promise<ApiResponse<unknown>>;
747
- };
748
-
749
- declare function createAuthEndpoints(client: ApiClient): {
750
- /**
751
- * List all active CLI access tokens for the current user.
752
- */
753
- listCliTokens(): Promise<ApiResponse<CliAccessTokenMetadata[]>>;
754
- /**
755
- * Revoke a specific CLI access token by its JTI.
756
- *
757
- * @param jti - The JWT ID of the token to revoke
758
- */
759
- revokeCliToken(jti: string): Promise<ApiResponse<{
760
- message: string;
761
- }>>;
762
- /**
763
- * Revoke all CLI access tokens for the current user.
764
- */
765
- revokeAllCliTokens(): Promise<ApiResponse<{
766
- message: string;
767
- count: number;
768
- }>>;
769
- };
770
-
771
- declare function createBillingEndpoints(client: ApiClient): {
772
- /**
773
- * Get current account usage for the billing period.
774
- */
775
- getUsage(): Promise<ApiResponse<AccountUsage>>;
776
- /**
777
- * Get account entitlements based on current plan.
778
- */
779
- getEntitlements(): Promise<ApiResponse<AccountEntitlements>>;
780
- /**
781
- * Get current subscription details.
782
- */
783
- getSubscription(): Promise<ApiResponse<Subscription>>;
784
- /**
785
- * Create a Stripe checkout session for upgrading/changing plan.
786
- */
787
- createCheckoutSession(options: CheckoutOptions): Promise<ApiResponse<CheckoutResponse>>;
788
- /**
789
- * Create a Stripe billing portal session for managing subscription.
790
- */
791
- createPortalSession(): Promise<ApiResponse<PortalResponse>>;
792
- };
793
-
794
- declare function createBoardsEndpoints(client: ApiClient): {
795
- /**
796
- * Get all boards for a website.
797
- */
798
- getBoards(websiteId: string): Promise<ApiResponse<Board[]>>;
799
- /**
800
- * Get a specific board by ID.
801
- */
802
- getBoard(boardId: string): Promise<ApiResponse<Board>>;
803
- /**
804
- * Create a new board.
805
- */
806
- createBoard(data: CreateBoardData): Promise<ApiResponse<Board>>;
807
- /**
808
- * Update a board.
809
- */
810
- updateBoard(boardId: string, data: UpdateBoardData): Promise<ApiResponse<Board>>;
811
- /**
812
- * Delete a board.
813
- */
814
- deleteBoard(boardId: string): Promise<ApiResponse<{
815
- ok: boolean;
816
- }>>;
817
- /**
818
- * Get all widgets for a board.
819
- */
820
- getBoardWidgets(boardId: string): Promise<ApiResponse<BoardWidget[]>>;
821
- /**
822
- * Get a specific widget by ID.
823
- */
824
- getBoardWidget(boardId: string, widgetId: string): Promise<ApiResponse<BoardWidget>>;
825
- /**
826
- * Create a new widget on a board.
827
- */
828
- createBoardWidget(boardId: string, data: CreateBoardWidgetData): Promise<ApiResponse<BoardWidget>>;
829
- /**
830
- * Update a widget.
831
- */
832
- updateBoardWidget(boardId: string, widgetId: string, data: UpdateBoardWidgetData): Promise<ApiResponse<BoardWidget>>;
833
- /**
834
- * Delete a widget.
835
- */
836
- deleteBoardWidget(boardId: string, widgetId: string): Promise<ApiResponse<{
837
- ok: boolean;
838
- }>>;
839
- };
840
-
841
- interface ConfigResponse {
842
- cloudMode: string;
843
- cloudUrl: string;
844
- defaultDateRange: number;
845
- defaultTimezone: string;
846
- disableBot: boolean;
847
- disableLogin: boolean;
848
- disableTelemetry: boolean;
849
- disableUI: boolean;
850
- forceSSL: boolean;
851
- hostname: string;
852
- isTelemetryEnabled: boolean;
853
- trackingCodeScriptUrl: string;
854
- uiDisabled: boolean;
855
- version: string;
856
- }
857
- declare function createConfigEndpoints(client: ApiClient): {
858
- /**
859
- * Get system configuration
860
- */
861
- get: () => Promise<ApiResponse<ConfigResponse>>;
862
- };
863
-
864
- declare function createEventsEndpoints(client: ApiClient): {
865
- /**
866
- * Get event data statistics.
867
- */
868
- getEventDataStats(websiteId: string, params: DateRangeParams): Promise<ApiResponse<EventStats>>;
869
- /**
870
- * Get event data events (distinct event names).
871
- */
872
- getEventDataEvents(websiteId: string, params: DateRangeParams): Promise<ApiResponse<{
873
- eventName: string;
874
- total: number;
875
- }[]>>;
876
- /**
877
- * Get event data fields for a specific event.
878
- */
879
- getEventDataFields(websiteId: string, params: DateRangeParams & {
880
- eventName: string;
881
- }): Promise<ApiResponse<EventDataField[]>>;
882
- /**
883
- * Get event data values for a specific field.
884
- */
885
- getEventDataValues(websiteId: string, params: DateRangeParams & {
886
- eventName: string;
887
- fieldName: string;
888
- }): Promise<ApiResponse<{
889
- fieldValue: string;
890
- total: number;
891
- }[]>>;
892
- /**
893
- * Get event data properties breakdown.
894
- */
895
- getEventDataProperties(websiteId: string, params: DateRangeParams & {
896
- eventName?: string;
897
- }): Promise<ApiResponse<EventData[]>>;
898
- /**
899
- * Get specific event data by ID.
900
- */
901
- getEventData(websiteId: string, eventId: string): Promise<ApiResponse<Record<string, unknown>>>;
902
- /**
903
- * Get session data properties.
904
- */
905
- getSessionDataProperties(websiteId: string, params: DateRangeParams): Promise<ApiResponse<{
906
- propertyName: string;
907
- total: number;
908
- }[]>>;
909
- getSessionDataValues(websiteId: string, params: DateRangeParams & {
910
- propertyName: string;
911
- }): Promise<ApiResponse<{
912
- propertyValue: string;
913
- total: number;
914
- }[]>>;
915
- /**
916
- * Send a test event to verify setup.
917
- */
918
- sendTestEvent(websiteId: string): Promise<ApiResponse<void>>;
919
- };
920
-
921
- interface IntegrationWordPressParams {
922
- data: unknown;
923
- }
924
- declare function createIntegrationsEndpoints(client: ApiClient): {
925
- /**
926
- * Handle WordPress integration
927
- */
928
- wordpress: (params: IntegrationWordPressParams) => Promise<ApiResponse<unknown>>;
929
- };
930
-
931
- declare function createLinksEndpoints(client: ApiClient): {
932
- /**
933
- * Get all links.
934
- */
935
- getLinks(): Promise<ApiResponse<Link[]>>;
936
- /**
937
- * Get links for an organization.
938
- */
939
- getOrgLinks(orgId: string): Promise<ApiResponse<Link[]>>;
940
- /**
941
- * Create a new link.
942
- */
943
- createLink(orgId: string, data: CreateLinkData): Promise<ApiResponse<Link>>;
944
- /**
945
- * Get a link by ID.
946
- */
947
- getLink(linkId: string): Promise<ApiResponse<Link>>;
948
- /**
949
- * Update a link.
950
- */
951
- updateLink(linkId: string, data: UpdateLinkData): Promise<ApiResponse<Link>>;
952
- /**
953
- * Delete a link.
954
- */
955
- deleteLink(linkId: string): Promise<ApiResponse<void>>;
956
- /**
957
- * Get link statistics.
958
- */
959
- getLinkStats(linkId: string): Promise<ApiResponse<Stats>>;
960
- };
961
-
962
- declare function createMeEndpoints(client: ApiClient): {
963
- /**
964
- * Get current user profile.
965
- */
966
- getMe(): Promise<ApiResponse<User>>;
967
- /**
968
- * Update current user's password.
969
- */
970
- updateMyPassword(data: {
971
- currentPassword: string;
972
- newPassword: string;
973
- }): Promise<ApiResponse<void>>;
974
- /**
975
- * Get current user's websites.
976
- */
977
- getMyWebsites(): Promise<ApiResponse<Website[]>>;
978
- /**
979
- * Get current user's organizations.
980
- */
981
- getMyOrgs(): Promise<ApiResponse<Organization[]>>;
982
- };
983
-
984
- declare function createOrgsEndpoints(client: ApiClient): {
985
- /**
986
- * Get all organizations for the current user.
987
- */
988
- getOrgs(): Promise<ApiResponse<Organization[]>>;
989
- /**
990
- * Create a new organization.
991
- */
992
- createOrg(data: CreateOrgData): Promise<ApiResponse<Organization>>;
993
- /**
994
- * Join an organization using access code.
995
- */
996
- joinOrg(data: JoinOrgData): Promise<ApiResponse<Organization>>;
997
- /**
998
- * Get an organization by ID.
999
- */
1000
- getOrg(orgId: string): Promise<ApiResponse<Organization>>;
1001
- /**
1002
- * Update an organization.
1003
- */
1004
- updateOrg(orgId: string, data: UpdateOrgData): Promise<ApiResponse<Organization>>;
1005
- /**
1006
- * Delete an organization.
1007
- */
1008
- deleteOrg(orgId: string): Promise<ApiResponse<void>>;
1009
- /**
1010
- * Get organization members.
1011
- */
1012
- getOrgUsers(orgId: string): Promise<ApiResponse<OrgUser[]>>;
1013
- /**
1014
- * Add a user to an organization.
1015
- */
1016
- addOrgUser(orgId: string, data: {
1017
- userId: string;
1018
- role: "admin" | "member" | "view-only";
1019
- }): Promise<ApiResponse<OrgUser>>;
1020
- /**
1021
- * Update an organization member's role.
1022
- */
1023
- updateOrgUser(orgId: string, userId: string, data: {
1024
- role: "admin" | "member" | "view-only";
1025
- }): Promise<ApiResponse<OrgUser>>;
1026
- /**
1027
- * Remove a user from an organization.
1028
- */
1029
- removeOrgUser(orgId: string, userId: string): Promise<ApiResponse<void>>;
1030
- /**
1031
- * Get organization websites.
1032
- */
1033
- getOrgWebsites(orgId: string): Promise<ApiResponse<Website[]>>;
1034
- /**
1035
- * Add a website to an organization.
1036
- */
1037
- addOrgWebsite(orgId: string, data: {
1038
- websiteId: string;
1039
- }): Promise<ApiResponse<Website>>;
1040
- /**
1041
- * Remove a website from an organization.
1042
- */
1043
- removeOrgWebsite(orgId: string, websiteId: string): Promise<ApiResponse<void>>;
1044
- };
1045
-
1046
- declare function createPixelsEndpoints(client: ApiClient): {
1047
- /**
1048
- * Get all pixels.
1049
- */
1050
- getPixels(): Promise<ApiResponse<Pixel[]>>;
1051
- /**
1052
- * Get pixels for an organization.
1053
- */
1054
- getOrgPixels(orgId: string): Promise<ApiResponse<Pixel[]>>;
1055
- /**
1056
- * Create a new pixel.
1057
- */
1058
- createPixel(orgId: string, data: CreatePixelData): Promise<ApiResponse<Pixel>>;
1059
- /**
1060
- * Get a pixel by ID.
1061
- */
1062
- getPixel(pixelId: string): Promise<ApiResponse<Pixel>>;
1063
- /**
1064
- * Update a pixel.
1065
- */
1066
- updatePixel(pixelId: string, data: UpdatePixelData): Promise<ApiResponse<Pixel>>;
1067
- /**
1068
- * Delete a pixel.
1069
- */
1070
- deletePixel(pixelId: string): Promise<ApiResponse<void>>;
1071
- };
1072
-
1073
- interface FunnelResult {
1074
- step: number;
1075
- name: string;
1076
- visitors: number;
1077
- dropoff: number;
1078
- rate: number;
1079
- }
1080
- interface RetentionResult {
1081
- date: string;
1082
- visitors: number;
1083
- returning: number[];
1084
- }
1085
- interface JourneyNode {
1086
- id: string;
1087
- name: string;
1088
- }
1089
- interface JourneyEdge {
1090
- source: string;
1091
- target: string;
1092
- value: number;
1093
- }
1094
- interface JourneyResult {
1095
- nodes: JourneyNode[];
1096
- edges: JourneyEdge[];
1097
- }
1098
- interface GoalResult {
1099
- goal: string;
1100
- visitors: number;
1101
- conversions: number;
1102
- rate: number;
1103
- }
1104
- interface AttributionResult {
1105
- channel: string;
1106
- visitors: number;
1107
- conversions: number;
1108
- revenue: number;
1109
- }
1110
- interface RevenueResult {
1111
- date: string;
1112
- revenue: number;
1113
- transactions: number;
1114
- averageOrder: number;
1115
- }
1116
- interface UTMResult {
1117
- source: string;
1118
- medium: string;
1119
- campaign: string;
1120
- visitors: number;
1121
- conversions: number;
1122
- }
1123
- interface BreakdownResult {
1124
- field: string;
1125
- value: string;
1126
- visitors: number;
1127
- pageviews: number;
1128
- }
1129
- declare function createReportsEndpoints(client: ApiClient): {
1130
- /**
1131
- * Get all reports for a website.
1132
- */
1133
- getReports(websiteId: string): Promise<ApiResponse<Report[]>>;
1134
- /**
1135
- * Create a new report.
1136
- */
1137
- createReport(data: CreateReportData): Promise<ApiResponse<Report>>;
1138
- /**
1139
- * Get a report by ID.
1140
- */
1141
- getReport(reportId: string): Promise<ApiResponse<Report>>;
1142
- /**
1143
- * Update a report.
1144
- */
1145
- updateReport(reportId: string, data: UpdateReportData): Promise<ApiResponse<Report>>;
1146
- /**
1147
- * Delete a report.
1148
- */
1149
- deleteReport(reportId: string): Promise<ApiResponse<void>>;
1150
- /**
1151
- * Run a funnel report.
1152
- */
1153
- runFunnelReport(params: DateRangeParams & {
1154
- websiteId: string;
1155
- steps: {
1156
- type: "path" | "event";
1157
- value: string;
1158
- }[];
1159
- window?: number;
1160
- }): Promise<ApiResponse<FunnelResult[]>>;
1161
- /**
1162
- * Run a retention report.
1163
- */
1164
- runRetentionReport(params: DateRangeParams & {
1165
- websiteId: string;
1166
- timezone?: string;
1167
- }): Promise<ApiResponse<RetentionResult[]>>;
1168
- /**
1169
- * Run a journey/flow report.
1170
- */
1171
- runJourneyReport(params: DateRangeParams & {
1172
- websiteId: string;
1173
- steps?: number;
1174
- startStep?: string;
1175
- endStep?: string;
1176
- }): Promise<ApiResponse<JourneyResult>>;
1177
- /**
1178
- * Run a goals report.
1179
- */
1180
- runGoalReport(params: DateRangeParams & {
1181
- websiteId: string;
1182
- type: string;
1183
- value: string;
1184
- }): Promise<ApiResponse<GoalResult[]>>;
1185
- /**
1186
- * Run an attribution report.
1187
- */
1188
- runAttributionReport(params: DateRangeParams & {
1189
- websiteId: string;
1190
- model: "first-click" | "last-click";
1191
- type: "path" | "event";
1192
- step: string;
1193
- currency?: string;
1194
- }): Promise<ApiResponse<AttributionResult[]>>;
1195
- /**
1196
- * Run a revenue report.
1197
- */
1198
- runRevenueReport(params: DateRangeParams & {
1199
- websiteId: string;
1200
- currency?: string;
1201
- }): Promise<ApiResponse<RevenueResult[]>>;
1202
- /**
1203
- * Run a UTM report.
1204
- */
1205
- runUTMReport(params: DateRangeParams & {
1206
- websiteId: string;
1207
- }): Promise<ApiResponse<UTMResult[]>>;
1208
- /**
1209
- * Run a breakdown report.
1210
- * @param property - Field to break down by (path, referrer, browser, device, os, country, etc.)
1211
- */
1212
- runBreakdownReport(params: DateRangeParams & {
1213
- websiteId: string;
1214
- property: string;
1215
- }): Promise<ApiResponse<BreakdownResult[]>>;
1216
- };
1217
-
1218
- declare function createSegmentsEndpoints(client: ApiClient): {
1219
- /**
1220
- * Get all segments for a website.
1221
- */
1222
- getSegments(websiteId: string): Promise<ApiResponse<Segment[]>>;
1223
- /**
1224
- * Create a new segment.
1225
- */
1226
- createSegment(websiteId: string, data: CreateSegmentData): Promise<ApiResponse<Segment>>;
1227
- /**
1228
- * Get a segment by ID.
1229
- */
1230
- getSegment(websiteId: string, segmentId: string): Promise<ApiResponse<Segment>>;
1231
- /**
1232
- * Update a segment.
1233
- */
1234
- updateSegment(websiteId: string, segmentId: string, data: UpdateSegmentData): Promise<ApiResponse<Segment>>;
1235
- /**
1236
- * Delete a segment.
1237
- */
1238
- deleteSegment(websiteId: string, segmentId: string): Promise<ApiResponse<void>>;
1239
- };
1240
-
1241
- declare function createSessionsEndpoints(client: ApiClient): {
1242
- /**
1243
- * Get website sessions.
1244
- */
1245
- getWebsiteSessions(websiteId: string, params: DateRangeParams & {
1246
- query?: string;
1247
- limit?: number;
1248
- offset?: number;
1249
- }): Promise<ApiResponse<Session[]>>;
1250
- /**
1251
- * Get session statistics.
1252
- */
1253
- getWebsiteSessionStats(websiteId: string, params: DateRangeParams): Promise<ApiResponse<SessionStats>>;
1254
- /**
1255
- * Get weekly session traffic.
1256
- */
1257
- getWeeklyTraffic(websiteId: string, params: DateRangeParams & {
1258
- timezone?: string;
1259
- }): Promise<ApiResponse<{
1260
- day: number;
1261
- hour: number;
1262
- y: number;
1263
- }[]>>;
1264
- /**
1265
- * Get a specific session.
1266
- */
1267
- getSession(websiteId: string, sessionId: string): Promise<ApiResponse<Session>>;
1268
- /**
1269
- * Get session activity (pageviews and events).
1270
- */
1271
- getSessionActivity(websiteId: string, sessionId: string, params: DateRangeParams): Promise<ApiResponse<SessionActivity[]>>;
1272
- /**
1273
- * Get session properties (custom data).
1274
- */
1275
- getSessionProperties(websiteId: string, sessionId: string): Promise<ApiResponse<Record<string, string | number | boolean>[]>>;
1276
- };
1277
-
1278
- declare function createUsersEndpoints(client: ApiClient): {
1279
- /**
1280
- * Get all users (admin only).
1281
- */
1282
- getUsers(): Promise<ApiResponse<User[]>>;
1283
- /**
1284
- * Create a new user (admin only).
1285
- */
1286
- createUser(data: CreateUserData): Promise<ApiResponse<User>>;
1287
- /**
1288
- * Get a user by ID.
1289
- */
1290
- getUser(userId: string): Promise<ApiResponse<User>>;
1291
- /**
1292
- * Update a user.
1293
- */
1294
- updateUser(userId: string, data: UpdateUserData): Promise<ApiResponse<User>>;
1295
- /**
1296
- * Delete a user (admin only).
1297
- */
1298
- deleteUser(userId: string): Promise<ApiResponse<void>>;
1299
- /**
1300
- * Get websites belonging to a user.
1301
- */
1302
- getUserWebsites(userId: string): Promise<ApiResponse<Website[]>>;
1303
- /**
1304
- * Get user usage statistics.
1305
- */
1306
- getUserUsage(userId: string, params: {
1307
- startAt: number;
1308
- endAt: number;
1309
- }): Promise<ApiResponse<{
1310
- websiteCount: number;
1311
- eventCount: number;
1312
- }>>;
1313
- };
1314
-
1315
- interface WebhookClerkParams {
1316
- data: unknown;
1317
- }
1318
- declare function createWebhooksEndpoints(client: ApiClient): {
1319
- /**
1320
- * Handle Clerk webhook
1321
- */
1322
- clerk: (params: WebhookClerkParams) => Promise<ApiResponse<unknown>>;
1323
- };
1324
-
1325
- declare function createWebsitesEndpoints(client: ApiClient): {
1326
- /**
1327
- * Get all websites.
1328
- */
1329
- getWebsites(): Promise<ApiResponse<Website[]>>;
1330
- /**
1331
- * Create a new website.
1332
- */
1333
- createWebsite(data: CreateWebsiteData): Promise<ApiResponse<Website>>;
1334
- /**
1335
- * Get a website by ID.
1336
- */
1337
- getWebsite(websiteId: string): Promise<ApiResponse<Website>>;
1338
- /**
1339
- * Update a website.
1340
- */
1341
- updateWebsite(websiteId: string, data: UpdateWebsiteData): Promise<ApiResponse<Website>>;
1342
- /**
1343
- * Delete a website.
1344
- */
1345
- deleteWebsite(websiteId: string): Promise<ApiResponse<void>>;
1346
- /**
1347
- * Reset a website's data.
1348
- */
1349
- resetWebsite(websiteId: string): Promise<ApiResponse<void>>;
1350
- /**
1351
- * Transfer website ownership.
1352
- */
1353
- transferWebsite(websiteId: string, data: {
1354
- userId?: string;
1355
- orgId?: string;
1356
- }): Promise<ApiResponse<Website>>;
1357
- /**
1358
- * Get website statistics.
1359
- */
1360
- getWebsiteStats(websiteId: string, params: DateRangeParams): Promise<ApiResponse<WebsiteStats>>;
1361
- /**
1362
- * Get website pageviews data.
1363
- */
1364
- getWebsitePageviews(websiteId: string, params: DateRangeParams & {
1365
- unit?: string;
1366
- timezone?: string;
1367
- }): Promise<ApiResponse<WebsitePageviews>>;
1368
- /**
1369
- * Get website metrics (URLs, referrers, browsers, etc.).
1370
- */
1371
- getWebsiteMetrics(websiteId: string, params: WebsiteMetricsParams): Promise<ApiResponse<MetricData[]>>;
1372
- /**
1373
- * Get expanded metrics (with additional details).
1374
- */
1375
- getWebsiteExpandedMetrics(websiteId: string, params: WebsiteMetricsParams): Promise<ApiResponse<MetricData[]>>;
1376
- /**
1377
- * Get website events.
1378
- */
1379
- getWebsiteEvents(websiteId: string, params: DateRangeParams & {
1380
- query?: string;
1381
- limit?: number;
1382
- offset?: number;
1383
- }): Promise<ApiResponse<WebsiteEvent[]>>;
1384
- /**
1385
- * Get events time series.
1386
- */
1387
- getWebsiteEventsSeries(websiteId: string, params: DateRangeParams & {
1388
- unit?: string;
1389
- timezone?: string;
1390
- event?: string;
1391
- }): Promise<ApiResponse<{
1392
- x: string;
1393
- y: number;
1394
- }[]>>;
1395
- /**
1396
- * Get active visitors count.
1397
- */
1398
- getWebsiteActive(websiteId: string): Promise<ApiResponse<ActiveVisitor[]>>;
1399
- /**
1400
- * Get website date range (first and last event dates).
1401
- */
1402
- getWebsiteDateRange(websiteId: string): Promise<ApiResponse<{
1403
- minDate: string;
1404
- maxDate: string;
1405
- }>>;
1406
- /**
1407
- * Get website values for a specific field.
1408
- */
1409
- getWebsiteValues(websiteId: string, params: DateRangeParams & {
1410
- type: string;
1411
- }): Promise<ApiResponse<string[]>>;
1412
- /**
1413
- * Get realtime data.
1414
- */
1415
- getRealtimeData(websiteId: string): Promise<ApiResponse<RealtimeData>>;
1416
- /**
1417
- * Export website data.
1418
- */
1419
- exportWebsiteData(websiteId: string, params: DateRangeParams & {
1420
- type: "csv" | "json";
1421
- }): Promise<ApiResponse<string>>;
1422
- /**
1423
- * Get website ingest mode configuration.
1424
- */
1425
- getWebsiteMode(websiteId: string): Promise<ApiResponse<WebsiteModeConfig>>;
1426
- /**
1427
- * Set website ingest mode (auto, node, or edge).
1428
- */
1429
- setWebsiteMode(websiteId: string, mode: IngestMode): Promise<ApiResponse<{
1430
- message: string;
1431
- }>>;
1432
- /**
1433
- * Get routing health status.
1434
- */
1435
- getRoutingHealth(): Promise<ApiResponse<RoutingHealth>>;
1436
- /**
1437
- * Get routing statistics.
1438
- */
1439
- getRoutingStats(params?: {
1440
- start?: string;
1441
- end?: string;
1442
- }): Promise<ApiResponse<RoutingStats>>;
1443
- /**
1444
- * Get Web Vitals statistics for a website.
1445
- * Note: Only available in entrolytics.
1446
- */
1447
- getWebsiteVitals(websiteId: string, params: WebVitalsParams): Promise<ApiResponse<WebVitalsStats[]>>;
1448
- /**
1449
- * Get individual Web Vital events.
1450
- * Note: Only available in entrolytics.
1451
- */
1452
- getWebsiteVitalEvents(websiteId: string, params: WebVitalsParams & {
1453
- limit?: number;
1454
- offset?: number;
1455
- }): Promise<ApiResponse<WebVital[]>>;
1456
- /**
1457
- * Track a Web Vital metric (send to collection endpoint).
1458
- * Note: Only available in entrolytics.
1459
- */
1460
- trackVital(websiteId: string, data: TrackVitalData): Promise<ApiResponse<{
1461
- success: boolean;
1462
- }>>;
1463
- /**
1464
- * Track multiple Web Vitals metrics in batch.
1465
- * Note: Only available in entrolytics.
1466
- */
1467
- trackVitalsBatch(websiteId: string, vitals: TrackVitalData[]): Promise<ApiResponse<{
1468
- success: boolean;
1469
- count: number;
1470
- }>>;
1471
- /**
1472
- * Get form analytics for a website.
1473
- * Note: Only available in entrolytics.
1474
- */
1475
- getWebsiteForms(websiteId: string, params: FormAnalyticsParams): Promise<ApiResponse<FormStats[]>>;
1476
- /**
1477
- * Get field-level analytics for a specific form.
1478
- * Note: Only available in entrolytics.
1479
- */
1480
- getFormFields(websiteId: string, formId: string, params: FormAnalyticsParams): Promise<ApiResponse<FormFieldStats[]>>;
1481
- /**
1482
- * Get individual form events.
1483
- * Note: Only available in entrolytics.
1484
- */
1485
- getFormEvents(websiteId: string, params: FormAnalyticsParams & {
1486
- limit?: number;
1487
- offset?: number;
1488
- }): Promise<ApiResponse<FormEvent[]>>;
1489
- /**
1490
- * Track a form event (send to collection endpoint).
1491
- * Note: Only available in entrolytics.
1492
- */
1493
- trackFormEvent(websiteId: string, data: TrackFormEventData): Promise<ApiResponse<{
1494
- success: boolean;
1495
- }>>;
1496
- /**
1497
- * Track multiple form events in batch.
1498
- * Note: Only available in entrolytics.
1499
- */
1500
- trackFormEventsBatch(websiteId: string, events: TrackFormEventData[]): Promise<ApiResponse<{
1501
- success: boolean;
1502
- count: number;
1503
- }>>;
1504
- /**
1505
- * Get deployments for a website.
1506
- * Note: Only available in entrolytics.
1507
- */
1508
- getWebsiteDeployments(websiteId: string, params: DeploymentParams): Promise<ApiResponse<Deployment[]>>;
1509
- /**
1510
- * Get a specific deployment.
1511
- * Note: Only available in entrolytics.
1512
- */
1513
- getDeployment(websiteId: string, deployId: string): Promise<ApiResponse<Deployment>>;
1514
- /**
1515
- * Compare two deployments.
1516
- * Note: Only available in entrolytics.
1517
- */
1518
- compareDeployments(websiteId: string, currentDeployId: string, previousDeployId?: string): Promise<ApiResponse<DeploymentComparison>>;
1519
- /**
1520
- * Set/register a deployment context.
1521
- * Note: Only available in entrolytics.
1522
- */
1523
- setDeployment(websiteId: string, data: SetDeploymentData): Promise<ApiResponse<Deployment>>;
1524
- };
1525
-
1526
- /**
1527
- * Runtime detection utilities for Node.js vs Edge environments
1528
- *
1529
- * @module runtime
1530
- * @example
1531
- * ```ts
1532
- * import { detectRuntime, isNodeRuntime, isEdgeRuntime } from 'entro-api/runtime';
1533
- *
1534
- * // Detect current runtime
1535
- * const runtime = detectRuntime();
1536
- * console.log(runtime); // 'node' | 'edge' | 'unknown'
1537
- *
1538
- * // Check specific runtime
1539
- * if (isNodeRuntime()) {
1540
- * // Use Node.js-specific features
1541
- * }
1542
- *
1543
- * if (isEdgeRuntime()) {
1544
- * // Use edge-compatible features only
1545
- * }
1546
- * ```
1547
- */
1548
- type Runtime = 'node' | 'edge' | 'unknown';
1549
- /**
1550
- * Detect the current JavaScript runtime environment
1551
- *
1552
- * @returns {Runtime} The detected runtime ('node', 'edge', or 'unknown')
1553
- *
1554
- * @example
1555
- * ```ts
1556
- * const runtime = detectRuntime();
1557
- *
1558
- * switch (runtime) {
1559
- * case 'node':
1560
- * console.log('Running in Node.js');
1561
- * break;
1562
- * case 'edge':
1563
- * console.log('Running in Edge Runtime');
1564
- * break;
1565
- * default:
1566
- * console.log('Unknown runtime');
1567
- * }
1568
- * ```
1569
- */
1570
- declare function detectRuntime(): Runtime;
1571
- /**
1572
- * Check if code is running in Node.js runtime
1573
- *
1574
- * @returns {boolean} True if running in Node.js
1575
- *
1576
- * @example
1577
- * ```ts
1578
- * if (isNodeRuntime()) {
1579
- * // Safe to use Node.js-only features
1580
- * const fs = require('fs');
1581
- * const data = fs.readFileSync('file.txt');
1582
- * }
1583
- * ```
1584
- */
1585
- declare function isNodeRuntime(): boolean;
1586
- /**
1587
- * Check if code is running in Edge runtime
1588
- *
1589
- * @returns {boolean} True if running in Edge runtime (Vercel, Netlify, Cloudflare)
1590
- *
1591
- * @example
1592
- * ```ts
1593
- * if (isEdgeRuntime()) {
1594
- * // Use only edge-compatible features
1595
- * const response = await fetch('https://api.example.com');
1596
- * }
1597
- * ```
1598
- */
1599
- declare function isEdgeRuntime(): boolean;
1600
- /**
1601
- * Get runtime capabilities
1602
- *
1603
- * @returns Runtime capabilities object
1604
- *
1605
- * @example
1606
- * ```ts
1607
- * const capabilities = getRuntimeCapabilities();
1608
- *
1609
- * if (capabilities.supportsFileSystem) {
1610
- * // Can use fs module
1611
- * }
1612
- *
1613
- * if (capabilities.supportsWebCrypto) {
1614
- * // Can use Web Crypto API
1615
- * }
1616
- * ```
1617
- */
1618
- declare function getRuntimeCapabilities(): {
1619
- runtime: Runtime;
1620
- isNode: boolean;
1621
- isEdge: boolean;
1622
- supportsFileSystem: boolean;
1623
- supportsWebCrypto: boolean;
1624
- supportsFetch: boolean;
1625
- supportsStreams: boolean;
1626
- };
1627
- /**
1628
- * Assert that code is running in a specific runtime
1629
- *
1630
- * @param {Runtime} expected - The expected runtime
1631
- * @throws {Error} If not running in the expected runtime
1632
- *
1633
- * @example
1634
- * ```ts
1635
- * // Ensure we're in edge runtime
1636
- * assertRuntime('edge');
1637
- *
1638
- * // Now safe to use edge-only features
1639
- * export const runtime = 'edge';
1640
- * ```
1641
- */
1642
- declare function assertRuntime(expected: Runtime): void;
1643
-
1644
- /**
1645
- * Edge runtime helper utilities
1646
- *
1647
- * Provides edge-compatible environment variable access, fetch utilities,
1648
- * and common patterns for edge deployments (Vercel, Netlify, Cloudflare).
1649
- *
1650
- * @module edge-helpers
1651
- * @example
1652
- * ```ts
1653
- * import { getEdgeEnv, createEdgeFetch, getRegionInfo } from 'entro-api/edge-helpers';
1654
- *
1655
- * // Access environment variables safely
1656
- * const apiKey = getEdgeEnv('API_KEY', 'default-key');
1657
- *
1658
- * // Create a fetch wrapper with retries
1659
- * const edgeFetch = createEdgeFetch({ retries: 3 });
1660
- * const response = await edgeFetch('https://api.example.com');
1661
- *
1662
- * // Get deployment region information
1663
- * const region = getRegionInfo();
1664
- * console.log(`Running in ${region.provider} region ${region.region}`);
1665
- * ```
1666
- */
1667
- /**
1668
- * Safely access environment variables in edge runtime
1669
- *
1670
- * @param {string} key - Environment variable name
1671
- * @param {string} [defaultValue] - Optional default value if variable not found
1672
- * @returns {string | undefined} The environment variable value or default
1673
- *
1674
- * @example
1675
- * ```ts
1676
- * // With default value
1677
- * const apiKey = getEdgeEnv('API_KEY', 'fallback-key');
1678
- *
1679
- * // Without default (returns undefined if not found)
1680
- * const optionalVar = getEdgeEnv('OPTIONAL_VAR');
1681
- * ```
1682
- */
1683
- declare function getEdgeEnv(key: string, defaultValue?: string): string | undefined;
1684
- /**
1685
- * Check if a required environment variable is set
1686
- *
1687
- * @param {string} key - Environment variable name
1688
- * @throws {Error} If the required variable is not set
1689
- *
1690
- * @example
1691
- * ```ts
1692
- * // Throws if DATABASE_URL is not set
1693
- * requireEdgeEnv('DATABASE_URL');
1694
- * ```
1695
- */
1696
- declare function requireEdgeEnv(key: string): string;
1697
- interface EdgeFetchOptions extends RequestInit {
1698
- /** Number of retry attempts (default: 3) */
1699
- retries?: number;
1700
- /** Base delay between retries in ms (default: 1000) */
1701
- retryDelay?: number;
1702
- /** Timeout in milliseconds (default: 30000) */
1703
- timeout?: number;
1704
- }
1705
- /**
1706
- * Create an edge-compatible fetch wrapper with retries and timeout
1707
- *
1708
- * @param {EdgeFetchOptions} [defaultOptions] - Default options for all requests
1709
- * @returns {Function} Enhanced fetch function
1710
- *
1711
- * @example
1712
- * ```ts
1713
- * const edgeFetch = createEdgeFetch({
1714
- * retries: 3,
1715
- * retryDelay: 1000,
1716
- * timeout: 10000,
1717
- * });
1718
- *
1719
- * // Fetch with automatic retries
1720
- * const response = await edgeFetch('https://api.example.com/data');
1721
- * ```
1722
- */
1723
- declare function createEdgeFetch(defaultOptions?: EdgeFetchOptions): (input: RequestInfo | URL, options?: EdgeFetchOptions) => Promise<Response>;
1724
- interface RegionInfo {
1725
- /** Cloud provider (vercel, netlify, cloudflare, unknown) */
1726
- provider: 'vercel' | 'netlify' | 'cloudflare' | 'unknown';
1727
- /** Region code (e.g., 'iad1', 'us-east-1') */
1728
- region?: string;
1729
- /** Whether running in edge runtime */
1730
- isEdge: boolean;
1731
- }
1732
- /**
1733
- * Get information about the current edge deployment region
1734
- *
1735
- * @returns {RegionInfo} Information about the deployment region
1736
- *
1737
- * @example
1738
- * ```ts
1739
- * const region = getRegionInfo();
1740
- *
1741
- * if (region.provider === 'vercel') {
1742
- * console.log(`Running in Vercel region: ${region.region}`);
1743
- * }
1744
- * ```
1745
- */
1746
- declare function getRegionInfo(): RegionInfo;
1747
- /**
1748
- * Extract geo information from edge request
1749
- *
1750
- * @param {Request} request - The incoming Request object
1751
- * @returns {Object} Geo information extracted from headers
1752
- *
1753
- * @example
1754
- * ```ts
1755
- * export async function POST(request: Request) {
1756
- * const geo = getGeoFromRequest(request);
1757
- * console.log(`Request from: ${geo.country}, ${geo.city}`);
1758
- * }
1759
- * ```
1760
- */
1761
- declare function getGeoFromRequest(request: Request): {
1762
- country: string;
1763
- region: string | null;
1764
- city: string | null;
1765
- latitude: string | null;
1766
- longitude: string | null;
1767
- } | {
1768
- country: undefined;
1769
- region: undefined;
1770
- city: undefined;
1771
- latitude: undefined;
1772
- longitude: undefined;
1773
- };
1774
- /**
1775
- * Get client IP address from edge request
1776
- *
1777
- * @param {Request} request - The incoming Request object
1778
- * @returns {string | undefined} The client IP address
1779
- *
1780
- * @example
1781
- * ```ts
1782
- * export async function POST(request: Request) {
1783
- * const clientIp = getClientIp(request);
1784
- * console.log(`Request from IP: ${clientIp}`);
1785
- * }
1786
- * ```
1787
- */
1788
- declare function getClientIp(request: Request): string | undefined;
1789
-
1790
- /**
1791
- * Entrolytics API client with all endpoints.
1792
- */
1793
- interface EntrolyticsClient {
1794
- auth: ReturnType<typeof createAuthEndpoints>;
1795
- getMe: ReturnType<typeof createMeEndpoints>['getMe'];
1796
- updateMyPassword: ReturnType<typeof createMeEndpoints>['updateMyPassword'];
1797
- getMyWebsites: ReturnType<typeof createMeEndpoints>['getMyWebsites'];
1798
- getMyOrgs: ReturnType<typeof createMeEndpoints>['getMyOrgs'];
1799
- getUsers: ReturnType<typeof createUsersEndpoints>['getUsers'];
1800
- createUser: ReturnType<typeof createUsersEndpoints>['createUser'];
1801
- getUser: ReturnType<typeof createUsersEndpoints>['getUser'];
1802
- updateUser: ReturnType<typeof createUsersEndpoints>['updateUser'];
1803
- deleteUser: ReturnType<typeof createUsersEndpoints>['deleteUser'];
1804
- getUserWebsites: ReturnType<typeof createUsersEndpoints>['getUserWebsites'];
1805
- getUserUsage: ReturnType<typeof createUsersEndpoints>['getUserUsage'];
1806
- getOrgs: ReturnType<typeof createOrgsEndpoints>['getOrgs'];
1807
- createOrg: ReturnType<typeof createOrgsEndpoints>['createOrg'];
1808
- joinOrg: ReturnType<typeof createOrgsEndpoints>['joinOrg'];
1809
- getOrg: ReturnType<typeof createOrgsEndpoints>['getOrg'];
1810
- updateOrg: ReturnType<typeof createOrgsEndpoints>['updateOrg'];
1811
- deleteOrg: ReturnType<typeof createOrgsEndpoints>['deleteOrg'];
1812
- getOrgUsers: ReturnType<typeof createOrgsEndpoints>['getOrgUsers'];
1813
- addOrgUser: ReturnType<typeof createOrgsEndpoints>['addOrgUser'];
1814
- updateOrgUser: ReturnType<typeof createOrgsEndpoints>['updateOrgUser'];
1815
- removeOrgUser: ReturnType<typeof createOrgsEndpoints>['removeOrgUser'];
1816
- getOrgWebsites: ReturnType<typeof createOrgsEndpoints>['getOrgWebsites'];
1817
- addOrgWebsite: ReturnType<typeof createOrgsEndpoints>['addOrgWebsite'];
1818
- removeOrgWebsite: ReturnType<typeof createOrgsEndpoints>['removeOrgWebsite'];
1819
- getWebsites: ReturnType<typeof createWebsitesEndpoints>['getWebsites'];
1820
- createWebsite: ReturnType<typeof createWebsitesEndpoints>['createWebsite'];
1821
- getWebsite: ReturnType<typeof createWebsitesEndpoints>['getWebsite'];
1822
- updateWebsite: ReturnType<typeof createWebsitesEndpoints>['updateWebsite'];
1823
- deleteWebsite: ReturnType<typeof createWebsitesEndpoints>['deleteWebsite'];
1824
- resetWebsite: ReturnType<typeof createWebsitesEndpoints>['resetWebsite'];
1825
- transferWebsite: ReturnType<typeof createWebsitesEndpoints>['transferWebsite'];
1826
- getWebsiteStats: ReturnType<typeof createWebsitesEndpoints>['getWebsiteStats'];
1827
- getWebsitePageviews: ReturnType<typeof createWebsitesEndpoints>['getWebsitePageviews'];
1828
- getWebsiteMetrics: ReturnType<typeof createWebsitesEndpoints>['getWebsiteMetrics'];
1829
- getWebsiteExpandedMetrics: ReturnType<typeof createWebsitesEndpoints>['getWebsiteExpandedMetrics'];
1830
- getWebsiteEvents: ReturnType<typeof createWebsitesEndpoints>['getWebsiteEvents'];
1831
- getWebsiteEventsSeries: ReturnType<typeof createWebsitesEndpoints>['getWebsiteEventsSeries'];
1832
- getWebsiteActive: ReturnType<typeof createWebsitesEndpoints>['getWebsiteActive'];
1833
- getWebsiteDateRange: ReturnType<typeof createWebsitesEndpoints>['getWebsiteDateRange'];
1834
- getWebsiteValues: ReturnType<typeof createWebsitesEndpoints>['getWebsiteValues'];
1835
- getRealtimeData: ReturnType<typeof createWebsitesEndpoints>['getRealtimeData'];
1836
- exportWebsiteData: ReturnType<typeof createWebsitesEndpoints>['exportWebsiteData'];
1837
- getWebsiteVitals: ReturnType<typeof createWebsitesEndpoints>['getWebsiteVitals'];
1838
- getWebsiteVitalEvents: ReturnType<typeof createWebsitesEndpoints>['getWebsiteVitalEvents'];
1839
- trackVital: ReturnType<typeof createWebsitesEndpoints>['trackVital'];
1840
- trackVitalsBatch: ReturnType<typeof createWebsitesEndpoints>['trackVitalsBatch'];
1841
- getWebsiteForms: ReturnType<typeof createWebsitesEndpoints>['getWebsiteForms'];
1842
- getFormFields: ReturnType<typeof createWebsitesEndpoints>['getFormFields'];
1843
- getFormEvents: ReturnType<typeof createWebsitesEndpoints>['getFormEvents'];
1844
- trackFormEvent: ReturnType<typeof createWebsitesEndpoints>['trackFormEvent'];
1845
- trackFormEventsBatch: ReturnType<typeof createWebsitesEndpoints>['trackFormEventsBatch'];
1846
- getWebsiteDeployments: ReturnType<typeof createWebsitesEndpoints>['getWebsiteDeployments'];
1847
- getDeployment: ReturnType<typeof createWebsitesEndpoints>['getDeployment'];
1848
- compareDeployments: ReturnType<typeof createWebsitesEndpoints>['compareDeployments'];
1849
- setDeployment: ReturnType<typeof createWebsitesEndpoints>['setDeployment'];
1850
- getWebsiteSessions: ReturnType<typeof createSessionsEndpoints>['getWebsiteSessions'];
1851
- getWebsiteSessionStats: ReturnType<typeof createSessionsEndpoints>['getWebsiteSessionStats'];
1852
- getWeeklyTraffic: ReturnType<typeof createSessionsEndpoints>['getWeeklyTraffic'];
1853
- getSession: ReturnType<typeof createSessionsEndpoints>['getSession'];
1854
- getSessionActivity: ReturnType<typeof createSessionsEndpoints>['getSessionActivity'];
1855
- getSessionProperties: ReturnType<typeof createSessionsEndpoints>['getSessionProperties'];
1856
- getEventDataStats: ReturnType<typeof createEventsEndpoints>['getEventDataStats'];
1857
- getEventDataEvents: ReturnType<typeof createEventsEndpoints>['getEventDataEvents'];
1858
- getEventDataFields: ReturnType<typeof createEventsEndpoints>['getEventDataFields'];
1859
- getEventDataValues: ReturnType<typeof createEventsEndpoints>['getEventDataValues'];
1860
- getEventDataProperties: ReturnType<typeof createEventsEndpoints>['getEventDataProperties'];
1861
- getEventData: ReturnType<typeof createEventsEndpoints>['getEventData'];
1862
- getSessionDataProperties: ReturnType<typeof createEventsEndpoints>['getSessionDataProperties'];
1863
- getSessionDataValues: ReturnType<typeof createEventsEndpoints>['getSessionDataValues'];
1864
- sendTestEvent: ReturnType<typeof createEventsEndpoints>['sendTestEvent'];
1865
- getReports: ReturnType<typeof createReportsEndpoints>['getReports'];
1866
- createReport: ReturnType<typeof createReportsEndpoints>['createReport'];
1867
- getReport: ReturnType<typeof createReportsEndpoints>['getReport'];
1868
- updateReport: ReturnType<typeof createReportsEndpoints>['updateReport'];
1869
- deleteReport: ReturnType<typeof createReportsEndpoints>['deleteReport'];
1870
- runFunnelReport: ReturnType<typeof createReportsEndpoints>['runFunnelReport'];
1871
- runRetentionReport: ReturnType<typeof createReportsEndpoints>['runRetentionReport'];
1872
- runJourneyReport: ReturnType<typeof createReportsEndpoints>['runJourneyReport'];
1873
- runGoalReport: ReturnType<typeof createReportsEndpoints>['runGoalReport'];
1874
- runAttributionReport: ReturnType<typeof createReportsEndpoints>['runAttributionReport'];
1875
- runRevenueReport: ReturnType<typeof createReportsEndpoints>['runRevenueReport'];
1876
- runUTMReport: ReturnType<typeof createReportsEndpoints>['runUTMReport'];
1877
- runBreakdownReport: ReturnType<typeof createReportsEndpoints>['runBreakdownReport'];
1878
- getSegments: ReturnType<typeof createSegmentsEndpoints>['getSegments'];
1879
- createSegment: ReturnType<typeof createSegmentsEndpoints>['createSegment'];
1880
- getSegment: ReturnType<typeof createSegmentsEndpoints>['getSegment'];
1881
- updateSegment: ReturnType<typeof createSegmentsEndpoints>['updateSegment'];
1882
- deleteSegment: ReturnType<typeof createSegmentsEndpoints>['deleteSegment'];
1883
- getLinks: ReturnType<typeof createLinksEndpoints>['getLinks'];
1884
- getOrgLinks: ReturnType<typeof createLinksEndpoints>['getOrgLinks'];
1885
- createLink: ReturnType<typeof createLinksEndpoints>['createLink'];
1886
- getLink: ReturnType<typeof createLinksEndpoints>['getLink'];
1887
- updateLink: ReturnType<typeof createLinksEndpoints>['updateLink'];
1888
- deleteLink: ReturnType<typeof createLinksEndpoints>['deleteLink'];
1889
- getLinkStats: ReturnType<typeof createLinksEndpoints>['getLinkStats'];
1890
- getPixels: ReturnType<typeof createPixelsEndpoints>['getPixels'];
1891
- getOrgPixels: ReturnType<typeof createPixelsEndpoints>['getOrgPixels'];
1892
- createPixel: ReturnType<typeof createPixelsEndpoints>['createPixel'];
1893
- getPixel: ReturnType<typeof createPixelsEndpoints>['getPixel'];
1894
- updatePixel: ReturnType<typeof createPixelsEndpoints>['updatePixel'];
1895
- deletePixel: ReturnType<typeof createPixelsEndpoints>['deletePixel'];
1896
- getBoards: ReturnType<typeof createBoardsEndpoints>['getBoards'];
1897
- getBoard: ReturnType<typeof createBoardsEndpoints>['getBoard'];
1898
- createBoard: ReturnType<typeof createBoardsEndpoints>['createBoard'];
1899
- updateBoard: ReturnType<typeof createBoardsEndpoints>['updateBoard'];
1900
- deleteBoard: ReturnType<typeof createBoardsEndpoints>['deleteBoard'];
1901
- getBoardWidgets: ReturnType<typeof createBoardsEndpoints>['getBoardWidgets'];
1902
- getBoardWidget: ReturnType<typeof createBoardsEndpoints>['getBoardWidget'];
1903
- createBoardWidget: ReturnType<typeof createBoardsEndpoints>['createBoardWidget'];
1904
- updateBoardWidget: ReturnType<typeof createBoardsEndpoints>['updateBoardWidget'];
1905
- deleteBoardWidget: ReturnType<typeof createBoardsEndpoints>['deleteBoardWidget'];
1906
- getConfig: ReturnType<typeof createConfigEndpoints>['get'];
1907
- admin: ReturnType<typeof createAdminEndpoints>;
1908
- webhooks: ReturnType<typeof createWebhooksEndpoints>;
1909
- integrations: ReturnType<typeof createIntegrationsEndpoints>;
1910
- billing: ReturnType<typeof createBillingEndpoints>;
1911
- }
1912
- /**
1913
- * Create an Entrolytics API client.
1914
- *
1915
- * @example
1916
- * ```ts
1917
- * // Using environment variables
1918
- * const client = getClient();
1919
- *
1920
- * // With explicit configuration
1921
- * const client = getClient({
1922
- * endpoint: 'https://analytics.example.com/api',
1923
- * apiKey: 'your-api-key',
1924
- * });
1925
- *
1926
- * // Make API calls
1927
- * const { ok, data, error } = await client.getWebsites();
1928
- * ```
1929
- */
1930
- declare function getClient(config?: ClientConfig): EntrolyticsClient;
1931
-
1932
- export { type AccountEntitlements, type AccountUsage, type ActiveVisitor, ApiClient, type ApiResponse, type Board, type BoardWidget, type CheckoutOptions, type CheckoutResponse, type ClientConfig, type CreateBoardData, type CreateBoardWidgetData, type CreateLinkData, type CreateOrgData, type CreatePixelData, type CreateReportData, type CreateSegmentData, type CreateUserData, type CreateWebsiteData, type DateRangeParams, type Deployment, type DeploymentComparison, type DeploymentParams, type EdgeFetchOptions, type EntrolyticsClient, type EventData, type EventDataField, type EventStats, type FormAnalyticsParams, type FormEvent, type FormEventType, type FormFieldStats, type FormStats, type IngestMode, type JoinOrgData, type Link, type LinkStats, type MetricData, type MetricType, type NavigationType, type OrgUser, type Organization, type OrganizationRole, type PageviewData, type PaginationParams, type Pixel, type PlanId, type PlatformRole, type PortalResponse, type RealtimeData, type RegionInfo, type Report, type RoutingHealth, type RoutingStats, type Runtime, type Segment, type Session, type SessionActivity, type SessionStats, type SetDeploymentData, type Stats, type Subscription, type TrackFormEventData, type TrackVitalData, type UpdateBoardData, type UpdateBoardWidgetData, type UpdateLinkData, type UpdateOrgData, type UpdatePixelData, type UpdateReportData, type UpdateSegmentData, type UpdateUserData, type UpdateWebsiteData, type User, type VitalMetric, type VitalRating, type WebVital, type WebVitalsParams, type WebVitalsStats, type Website, type WebsiteEvent, type WebsiteMetricsParams, type WebsiteModeConfig, type WebsitePageviews, type WebsiteStats, assertRuntime, createAdminEndpoints, createAuthEndpoints, createBillingEndpoints, createBoardsEndpoints, createConfigEndpoints, createEdgeFetch, createEventsEndpoints, createIntegrationsEndpoints, createLinksEndpoints, createMeEndpoints, createOrgsEndpoints, createPixelsEndpoints, createReportsEndpoints, createSegmentsEndpoints, createSessionsEndpoints, createUsersEndpoints, createWebhooksEndpoints, createWebsitesEndpoints, getClient as default, detectRuntime, getClient, getClientIp, getEdgeEnv, getGeoFromRequest, getRegionInfo, getRuntimeCapabilities, isEdgeRuntime, isNodeRuntime, requireEdgeEnv };