@entrolytics/shared 3.0.1 → 3.1.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.
package/dist/index.js DELETED
@@ -1,716 +0,0 @@
1
- //#region src/event-protocol.ts
2
- /**
3
- * Event Protocol Types
4
- *
5
- * These types define the canonical event structures used across the Entrolytics ecosystem.
6
- * Used by: API Server, SDKs, CLI, worker processes.
7
- *
8
- * This file was extracted from the internal @entrolytics/protocol package to enable
9
- * sharing with external packages.
10
- */
11
- /**
12
- * Core event types supported by the analytics platform
13
- */
14
- const EventType = {
15
- PageView: "pageview",
16
- Custom: "custom_event",
17
- Click: "click"
18
- };
19
-
20
- //#endregion
21
- //#region src/index.ts
22
- /**
23
- * Shared constants across Entrolytics ecosystem
24
- * Used by: CLI, SDKs, Dashboard, Integrations
25
- */
26
- /**
27
- * Plan definitions and limits
28
- */
29
- const PLANS = {
30
- starter: {
31
- id: "starter",
32
- name: "Starter",
33
- price: 0,
34
- limits: {
35
- pageviewsPerMonth: 25e3,
36
- websites: 2,
37
- retentionDays: 30,
38
- seats: 1
39
- },
40
- features: {
41
- funnels: false,
42
- attribution: false,
43
- revenue: false,
44
- customDashboards: false,
45
- apiAccess: false,
46
- weeklyReports: true,
47
- support: "community"
48
- }
49
- },
50
- pro: {
51
- id: "pro",
52
- name: "Pro",
53
- price: 29,
54
- limits: {
55
- pageviewsPerMonth: 25e4,
56
- websites: 10,
57
- retentionDays: 365,
58
- seats: 5
59
- },
60
- features: {
61
- funnels: true,
62
- attribution: true,
63
- revenue: true,
64
- customDashboards: false,
65
- apiAccess: true,
66
- weeklyReports: true,
67
- support: "email"
68
- }
69
- },
70
- business: {
71
- id: "business",
72
- name: "Business",
73
- price: 99,
74
- limits: {
75
- pageviewsPerMonth: 1e6,
76
- websites: -1,
77
- retentionDays: 730,
78
- seats: -1
79
- },
80
- features: {
81
- funnels: true,
82
- attribution: true,
83
- revenue: true,
84
- customDashboards: true,
85
- apiAccess: true,
86
- weeklyReports: true,
87
- support: "priority"
88
- }
89
- },
90
- enterprise: {
91
- id: "enterprise",
92
- name: "Enterprise",
93
- price: -1,
94
- limits: {
95
- pageviewsPerMonth: -1,
96
- websites: -1,
97
- retentionDays: -1,
98
- seats: -1
99
- },
100
- features: {
101
- funnels: true,
102
- attribution: true,
103
- revenue: true,
104
- customDashboards: true,
105
- apiAccess: true,
106
- weeklyReports: true,
107
- support: "dedicated",
108
- sso: true,
109
- auditLogs: true,
110
- customRetention: true
111
- }
112
- }
113
- };
114
- /**
115
- * Plan feature names for display
116
- */
117
- const PLAN_FEATURES = {
118
- funnels: "Funnel Analytics",
119
- attribution: "Attribution Reports",
120
- revenue: "Revenue Tracking",
121
- customDashboards: "Custom Dashboards",
122
- apiAccess: "API Access",
123
- weeklyReports: "Weekly Email Reports",
124
- sso: "SSO/SAML",
125
- auditLogs: "Audit Logs",
126
- customRetention: "Custom Data Retention"
127
- };
128
- /**
129
- * Usage warning thresholds (percentages)
130
- */
131
- const USAGE_THRESHOLDS = {
132
- warning: 90,
133
- critical: 95
134
- };
135
- /**
136
- * Billing-related error codes
137
- */
138
- const BILLING_ERRORS = {
139
- quotaExceeded: "QUOTA_EXCEEDED",
140
- planRequired: "PLAN_REQUIRED",
141
- featureNotAvailable: "FEATURE_NOT_AVAILABLE",
142
- subscriptionInactive: "SUBSCRIPTION_INACTIVE",
143
- paymentFailed: "PAYMENT_FAILED"
144
- };
145
- /**
146
- * API endpoint configuration
147
- */
148
- const API_ENDPOINTS = {
149
- production: "https://api.entrolytics.click",
150
- development: "http://localhost:3001"
151
- };
152
- /**
153
- * Default API host
154
- */
155
- const DEFAULT_API_HOST = getEnv()?.NODE_ENV === "production" ? API_ENDPOINTS.production : API_ENDPOINTS.development;
156
- /**
157
- * Environment variable naming conventions by framework
158
- */
159
- const ENV_VAR_NAMES = {
160
- nextjs: {
161
- websiteId: "NEXT_PUBLIC_ENTROLYTICS_WEBSITE_ID",
162
- host: "NEXT_PUBLIC_ENTROLYTICS_HOST",
163
- envFile: ".env.local"
164
- },
165
- react: {
166
- websiteId: "VITE_ENTROLYTICS_WEBSITE_ID",
167
- host: "VITE_ENTROLYTICS_HOST",
168
- envFile: ".env"
169
- },
170
- vue: {
171
- websiteId: "VITE_ENTROLYTICS_WEBSITE_ID",
172
- host: "VITE_ENTROLYTICS_HOST",
173
- envFile: ".env"
174
- },
175
- svelte: {
176
- websiteId: "PUBLIC_ENTROLYTICS_WEBSITE_ID",
177
- host: "PUBLIC_ENTROLYTICS_HOST",
178
- envFile: ".env"
179
- },
180
- astro: {
181
- websiteId: "PUBLIC_ENTROLYTICS_WEBSITE_ID",
182
- host: "PUBLIC_ENTROLYTICS_HOST",
183
- envFile: ".env"
184
- },
185
- html: {
186
- websiteId: "ENTROLYTICS_WEBSITE_ID",
187
- host: "ENTROLYTICS_HOST",
188
- envFile: ".env"
189
- },
190
- node: {
191
- websiteId: "ENTROLYTICS_WEBSITE_ID",
192
- host: "ENTROLYTICS_HOST",
193
- envFile: ".env"
194
- },
195
- php: {
196
- websiteId: "ENTROLYTICS_WEBSITE_ID",
197
- host: "ENTROLYTICS_HOST",
198
- envFile: ".env"
199
- },
200
- python: {
201
- websiteId: "ENTROLYTICS_WEBSITE_ID",
202
- host: "ENTROLYTICS_HOST",
203
- envFile: ".env"
204
- },
205
- go: {
206
- websiteId: "ENTROLYTICS_WEBSITE_ID",
207
- host: "ENTROLYTICS_HOST",
208
- envFile: ".env"
209
- }
210
- };
211
- /**
212
- * CLI configuration constants
213
- */
214
- const CLI_CONFIG = {
215
- tokenExpiryMinutes: 15,
216
- maxTokensPerUser: 10,
217
- pollIntervalMs: 2e3,
218
- setupTimeoutMs: 3e5,
219
- minCliVersion: "1.0.0"
220
- };
221
- /**
222
- * Core event types - matches backend protocol values exactly
223
- * Used by: API Server, SDKs, CLI, worker processes
224
- * See: entrolytics/packages/protocol/src/events.ts
225
- */
226
- const EVENT_TYPES = {
227
- pageView: "pageview",
228
- custom: "custom_event",
229
- click: "click"
230
- };
231
- /**
232
- * Extended event types for SDK-level semantics
233
- * These are higher-level event categories used by SDKs
234
- * They map to the core EVENT_TYPES when sent to the backend
235
- */
236
- const SDK_EVENT_TYPES = {
237
- pageView: "pageview",
238
- click: "click",
239
- formSubmit: "form_submit",
240
- custom: "custom_event",
241
- error: "error",
242
- performance: "performance"
243
- };
244
- /**
245
- * Web Vitals metric types (Phase 2)
246
- * Core Web Vitals: LCP, INP, CLS
247
- * Additional: TTFB, FCP
248
- */
249
- const VITAL_TYPES = {
250
- LCP: "LCP",
251
- INP: "INP",
252
- CLS: "CLS",
253
- TTFB: "TTFB",
254
- FCP: "FCP"
255
- };
256
- /**
257
- * Web Vitals rating thresholds
258
- */
259
- const VITAL_RATINGS = {
260
- good: "good",
261
- needsImprovement: "needs-improvement",
262
- poor: "poor"
263
- };
264
- /**
265
- * Web Vitals thresholds by metric (in milliseconds, except CLS which is unitless)
266
- */
267
- const VITAL_THRESHOLDS = {
268
- LCP: {
269
- good: 2500,
270
- poor: 4e3
271
- },
272
- INP: {
273
- good: 200,
274
- poor: 500
275
- },
276
- CLS: {
277
- good: .1,
278
- poor: .25
279
- },
280
- TTFB: {
281
- good: 800,
282
- poor: 1800
283
- },
284
- FCP: {
285
- good: 1800,
286
- poor: 3e3
287
- }
288
- };
289
- /**
290
- * Navigation types for Web Vitals context
291
- */
292
- const NAVIGATION_TYPES = {
293
- navigate: "navigate",
294
- reload: "reload",
295
- backForward: "back-forward",
296
- backForwardCache: "back-forward-cache",
297
- prerender: "prerender",
298
- restore: "restore",
299
- softNavigation: "soft-navigation"
300
- };
301
- /**
302
- * Form event types (Phase 2)
303
- */
304
- const FORM_EVENT_TYPES = {
305
- start: "start",
306
- fieldFocus: "field_focus",
307
- fieldBlur: "field_blur",
308
- fieldError: "field_error",
309
- submit: "submit",
310
- abandon: "abandon"
311
- };
312
- /**
313
- * Form field types
314
- */
315
- const FORM_FIELD_TYPES = {
316
- text: "text",
317
- email: "email",
318
- password: "password",
319
- tel: "tel",
320
- number: "number",
321
- url: "url",
322
- textarea: "textarea",
323
- select: "select",
324
- checkbox: "checkbox",
325
- radio: "radio",
326
- date: "date",
327
- file: "file",
328
- hidden: "hidden",
329
- submit: "submit",
330
- other: "other"
331
- };
332
- /**
333
- * Deployment platform sources (Phase 2)
334
- */
335
- const DEPLOYMENT_SOURCES = {
336
- vercel: "vercel",
337
- netlify: "netlify",
338
- cloudflare: "cloudflare",
339
- railway: "railway",
340
- render: "render",
341
- fly: "fly",
342
- heroku: "heroku",
343
- aws: "aws",
344
- gcp: "gcp",
345
- azure: "azure",
346
- custom: "custom"
347
- };
348
- /**
349
- * Deployment environment variables by platform
350
- */
351
- const DEPLOYMENT_ENV_VARS = {
352
- vercel: {
353
- deployId: "VERCEL_DEPLOYMENT_ID",
354
- gitSha: "VERCEL_GIT_COMMIT_SHA",
355
- gitBranch: "VERCEL_GIT_COMMIT_REF",
356
- url: "VERCEL_URL"
357
- },
358
- netlify: {
359
- deployId: "DEPLOY_ID",
360
- gitSha: "COMMIT_REF",
361
- gitBranch: "BRANCH",
362
- url: "DEPLOY_URL"
363
- },
364
- cloudflare: {
365
- deployId: "CF_PAGES_COMMIT_SHA",
366
- gitSha: "CF_PAGES_COMMIT_SHA",
367
- gitBranch: "CF_PAGES_BRANCH",
368
- url: "CF_PAGES_URL"
369
- }
370
- };
371
- /**
372
- * HTTP status codes
373
- */
374
- const HTTP_STATUS = {
375
- ok: 200,
376
- created: 201,
377
- accepted: 202,
378
- noContent: 204,
379
- badRequest: 400,
380
- unauthorized: 401,
381
- forbidden: 403,
382
- notFound: 404,
383
- conflict: 409,
384
- tooManyRequests: 429,
385
- internalServerError: 500,
386
- serviceUnavailable: 503
387
- };
388
- /**
389
- * API route paths
390
- */
391
- const API_ROUTES = {
392
- cliAuthToken: "/api/auth/cli/token",
393
- cliAuthTokens: "/api/auth/cli/tokens",
394
- cliValidate: "/api/auth/cli/validate",
395
- shareToken: (shareId) => `/api/share/${shareId}`,
396
- links: "/api/links",
397
- linkRedirect: (slug) => `/q/${slug}`,
398
- websites: "/api/websites",
399
- websiteById: (id) => `/api/websites/${id}`,
400
- websiteEvents: (id) => `/api/websites/${id}/events`,
401
- websiteRecentEvents: (id) => `/api/websites/${id}/recent-events`,
402
- userOnboarding: "/api/user/onboarding",
403
- userProfile: "/api/user/profile",
404
- userEmailPreferences: "/api/me/email-preferences",
405
- billingUsage: "/api/billing/usage",
406
- billingCheckout: "/api/billing/checkout",
407
- billingPortal: "/api/billing/portal",
408
- billingWebhook: "/api/billing/webhook",
409
- analyticsOverview: (websiteId) => `/api/analytics/${websiteId}/overview`,
410
- analyticsTimeseries: (websiteId) => `/api/analytics/${websiteId}/timeseries`,
411
- analyticsTopPages: (websiteId) => `/api/analytics/${websiteId}/top-pages`,
412
- analyticsTopReferrers: (websiteId) => `/api/analytics/${websiteId}/top-referrers`,
413
- analyticsGeography: (websiteId) => `/api/analytics/${websiteId}/geography`,
414
- analyticsDevices: (websiteId) => `/api/analytics/${websiteId}/devices`,
415
- collect: "/collect",
416
- collectBatch: "/collect/batch",
417
- send: "/collect",
418
- collectVitals: "/api/collect/vitals",
419
- collectVitalsBatch: "/api/collect/vitals/batch",
420
- collectForms: "/api/collect/forms",
421
- collectFormsBatch: "/api/collect/forms/batch",
422
- vitalsOverview: "/api/vitals/overview",
423
- vitalsByPage: "/api/vitals/by-page",
424
- vitalsTrend: "/api/vitals/trend",
425
- vitalsRecent: "/api/vitals/recent",
426
- vitalsPageBreakdown: "/api/vitals/page-breakdown",
427
- formsConversions: "/api/forms/conversions",
428
- formsFieldMetrics: "/api/forms/field-metrics",
429
- formsFunnel: "/api/forms/funnel",
430
- formsRecent: "/api/forms/recent",
431
- deployments: "/api/deployments",
432
- deploymentByWebsite: (id) => `/api/deployments/${id}`,
433
- deploymentCompare: (id) => `/api/deployments/${id}/compare`,
434
- deploymentLatest: (id) => `/api/deployments/${id}/latest`,
435
- health: "/api/health",
436
- healthIntegrations: "/api/health/integrations"
437
- };
438
- /**
439
- * Onboarding step identifiers
440
- */
441
- const ONBOARDING_STEPS = {
442
- welcome: "welcome",
443
- createWebsite: "create-website",
444
- installTracking: "install-tracking",
445
- verify: "verify",
446
- complete: "complete",
447
- skipped: "skipped"
448
- };
449
- /**
450
- * CLI token statuses
451
- */
452
- const CLI_TOKEN_STATUS = {
453
- pending: "pending",
454
- used: "used",
455
- expired: "expired",
456
- revoked: "revoked"
457
- };
458
- /**
459
- * User roles
460
- */
461
- const USER_ROLES = {
462
- admin: "admin",
463
- user: "user",
464
- viewer: "viewer"
465
- };
466
- /**
467
- * Framework package names
468
- */
469
- const FRAMEWORK_PACKAGES = {
470
- nextjs: "@entrolytics/nextjs-sdk",
471
- react: "@entrolytics/react-sdk",
472
- vue: "@entrolytics/vue-sdk",
473
- svelte: "@entrolytics/svelte-sdk",
474
- astro: "@entrolytics/astro-sdk",
475
- node: "@entrolytics/node-sdk"
476
- };
477
- /**
478
- * Framework detection patterns
479
- */
480
- const FRAMEWORK_PATTERNS = {
481
- nextjs: {
482
- files: [
483
- "next.config.js",
484
- "next.config.mjs",
485
- "next.config.ts"
486
- ],
487
- dependencies: ["next"]
488
- },
489
- react: {
490
- files: ["vite.config.js", "vite.config.ts"],
491
- dependencies: ["react", "vite"]
492
- },
493
- vue: {
494
- files: ["vite.config.js", "vite.config.ts"],
495
- dependencies: ["vue", "vite"]
496
- },
497
- svelte: {
498
- files: ["svelte.config.js", "svelte.config.ts"],
499
- dependencies: ["svelte"]
500
- },
501
- astro: {
502
- files: ["astro.config.mjs", "astro.config.ts"],
503
- dependencies: ["astro"]
504
- }
505
- };
506
- /**
507
- * Rate limiting configuration
508
- * Updated to match server-side implementation
509
- */
510
- const RATE_LIMITS = {
511
- cliTokenExchange: {
512
- windowSeconds: 60,
513
- maxRequests: 5
514
- },
515
- shareTokenGeneration: {
516
- windowSeconds: 60,
517
- maxRequests: 10
518
- },
519
- linkCreation: {
520
- windowSeconds: 60,
521
- maxRequests: 20
522
- },
523
- linkRedirect: {
524
- windowSeconds: 60,
525
- maxRequests: 100
526
- },
527
- apiGeneral: {
528
- windowSeconds: 60,
529
- maxRequests: 100
530
- }
531
- };
532
- /**
533
- * Error messages
534
- */
535
- const ERROR_MESSAGES = {
536
- unauthorized: "Unauthorized access",
537
- forbidden: "Access forbidden",
538
- tokenExpired: "Token has expired",
539
- tokenInvalid: "Invalid token",
540
- tokenNotFound: "Token not found",
541
- tokenAlreadyUsed: "Token has already been used",
542
- tokenRevoked: "Token has been revoked",
543
- tokenMissingJti: "Token missing JTI - please re-authenticate",
544
- userBanned: "User account has been banned",
545
- userDeleted: "User account has been deleted",
546
- shareTokenExpired: "Share token has expired",
547
- shareTokenRevoked: "Share has been revoked",
548
- shareTokenInvalid: "Invalid share token",
549
- invalidUrl: "Invalid URL provided",
550
- invalidUrlProtocol: "URL must use http or https protocol",
551
- openRedirectBlocked: "Open redirect attempt blocked",
552
- invalidInput: "Invalid input provided",
553
- missingRequired: "Missing required fields",
554
- invalidFormat: "Invalid format",
555
- notFound: "Resource not found",
556
- websiteNotFound: "Website not found",
557
- userNotFound: "User not found",
558
- linkNotFound: "Link not found",
559
- tooManyRequests: "Too many requests. Please try again later.",
560
- rateLimitExceeded: "Rate limit exceeded",
561
- internalError: "Internal server error",
562
- serviceUnavailable: "Service temporarily unavailable"
563
- };
564
- /**
565
- * Success messages
566
- */
567
- const SUCCESS_MESSAGES = {
568
- tokenGenerated: "Setup token generated successfully",
569
- tokenValidated: "Token validated successfully",
570
- tokenRevoked: "Token revoked successfully",
571
- allTokensRevoked: "All tokens revoked successfully",
572
- websiteCreated: "Website created successfully",
573
- linkCreated: "Link created successfully",
574
- shareCreated: "Share created successfully",
575
- onboardingComplete: "Onboarding completed successfully",
576
- setupComplete: "Setup completed successfully"
577
- };
578
- const EVENT_TYPE_VALUES = Object.values(EVENT_TYPES);
579
- const SDK_EVENT_TYPE_VALUES = Object.values(SDK_EVENT_TYPES);
580
- const VITAL_TYPE_VALUES = Object.values(VITAL_TYPES);
581
- const VITAL_RATING_VALUES = Object.values(VITAL_RATINGS);
582
- const NAVIGATION_TYPE_VALUES = Object.values(NAVIGATION_TYPES);
583
- const FORM_EVENT_TYPE_VALUES = Object.values(FORM_EVENT_TYPES);
584
- const FORM_FIELD_TYPE_VALUES = Object.values(FORM_FIELD_TYPES);
585
- const DEPLOYMENT_SOURCE_VALUES = Object.values(DEPLOYMENT_SOURCES);
586
- function isEventType(value) {
587
- return EVENT_TYPE_VALUES.includes(value);
588
- }
589
- function isSdkEventType(value) {
590
- return SDK_EVENT_TYPE_VALUES.includes(value);
591
- }
592
- function isVitalType(value) {
593
- return VITAL_TYPE_VALUES.includes(value);
594
- }
595
- function isVitalRating(value) {
596
- return VITAL_RATING_VALUES.includes(value);
597
- }
598
- function isNavigationType(value) {
599
- return NAVIGATION_TYPE_VALUES.includes(value);
600
- }
601
- function isFormEventType(value) {
602
- return FORM_EVENT_TYPE_VALUES.includes(value);
603
- }
604
- function isFormFieldType(value) {
605
- return FORM_FIELD_TYPE_VALUES.includes(value);
606
- }
607
- function isDeploymentSource(value) {
608
- return DEPLOYMENT_SOURCE_VALUES.includes(value);
609
- }
610
- function normalizeDeploymentSource(value) {
611
- if (!value) return "custom";
612
- return isDeploymentSource(value) ? value : "custom";
613
- }
614
- /**
615
- * Utility functions
616
- */
617
- function getEnvVarNames(framework) {
618
- return ENV_VAR_NAMES[framework];
619
- }
620
- function getFrameworkPackage(framework) {
621
- return FRAMEWORK_PACKAGES[framework] || null;
622
- }
623
- function isValidFramework(framework) {
624
- return framework in ENV_VAR_NAMES;
625
- }
626
- function getApiRoute(route, ...args) {
627
- const routeFn = API_ROUTES[route];
628
- if (typeof routeFn === "function") return routeFn(...args);
629
- return routeFn;
630
- }
631
- /**
632
- * Get plan by ID
633
- */
634
- function getPlan(planId) {
635
- return PLANS[planId];
636
- }
637
- /**
638
- * Check if a feature is available for a plan
639
- */
640
- function isPlanFeatureEnabled(planId, feature) {
641
- return PLANS[planId]?.features?.[feature] === true;
642
- }
643
- /**
644
- * Get plan limit value (-1 means unlimited)
645
- */
646
- function getPlanLimit(planId, limit) {
647
- return PLANS[planId]?.limits?.[limit] ?? 0;
648
- }
649
- /**
650
- * Check if usage is at warning threshold
651
- */
652
- function isUsageWarning(current, limit) {
653
- if (limit <= 0) return false;
654
- return current / limit * 100 >= USAGE_THRESHOLDS.warning;
655
- }
656
- /**
657
- * Check if usage is at critical threshold
658
- */
659
- function isUsageCritical(current, limit) {
660
- if (limit <= 0) return false;
661
- return current / limit * 100 >= USAGE_THRESHOLDS.critical;
662
- }
663
- /**
664
- * Calculate Web Vital rating from value (Phase 2)
665
- */
666
- function getVitalRating(metric, value) {
667
- const thresholds = VITAL_THRESHOLDS[metric];
668
- if (value <= thresholds.good) return "good";
669
- if (value <= thresholds.poor) return "needs-improvement";
670
- return "poor";
671
- }
672
- /**
673
- * Detect deployment context from environment variables (Phase 2)
674
- * Works in Node.js environments only - returns null in browser
675
- */
676
- function detectDeploymentContext() {
677
- const env = getEnv();
678
- if (!env) return null;
679
- if (env.VERCEL_DEPLOYMENT_ID) return {
680
- deployId: env.VERCEL_DEPLOYMENT_ID,
681
- gitSha: env.VERCEL_GIT_COMMIT_SHA,
682
- gitBranch: env.VERCEL_GIT_COMMIT_REF,
683
- deployUrl: env.VERCEL_URL ? `https://${env.VERCEL_URL}` : void 0,
684
- source: "vercel"
685
- };
686
- if (env.DEPLOY_ID) return {
687
- deployId: env.DEPLOY_ID,
688
- gitSha: env.COMMIT_REF,
689
- gitBranch: env.BRANCH,
690
- deployUrl: env.DEPLOY_URL,
691
- source: "netlify"
692
- };
693
- if (env.CF_PAGES_COMMIT_SHA) return {
694
- deployId: env.CF_PAGES_COMMIT_SHA,
695
- gitSha: env.CF_PAGES_COMMIT_SHA,
696
- gitBranch: env.CF_PAGES_BRANCH,
697
- deployUrl: env.CF_PAGES_URL,
698
- source: "cloudflare"
699
- };
700
- return null;
701
- }
702
- /**
703
- * Safe environment variable access (works in browser and Node.js)
704
- */
705
- function getEnv() {
706
- try {
707
- if (typeof globalThis !== "undefined" && "process" in globalThis) return globalThis.process?.env ?? null;
708
- return null;
709
- } catch {
710
- return null;
711
- }
712
- }
713
-
714
- //#endregion
715
- export { API_ENDPOINTS, API_ROUTES, BILLING_ERRORS, CLI_CONFIG, CLI_TOKEN_STATUS, DEFAULT_API_HOST, DEPLOYMENT_ENV_VARS, DEPLOYMENT_SOURCES, DEPLOYMENT_SOURCE_VALUES, ENV_VAR_NAMES, ERROR_MESSAGES, EVENT_TYPES, EVENT_TYPE_VALUES, EventType, FORM_EVENT_TYPES, FORM_EVENT_TYPE_VALUES, FORM_FIELD_TYPES, FORM_FIELD_TYPE_VALUES, FRAMEWORK_PACKAGES, FRAMEWORK_PATTERNS, HTTP_STATUS, NAVIGATION_TYPES, NAVIGATION_TYPE_VALUES, ONBOARDING_STEPS, PLANS, PLAN_FEATURES, RATE_LIMITS, SDK_EVENT_TYPES, SDK_EVENT_TYPE_VALUES, SUCCESS_MESSAGES, USAGE_THRESHOLDS, USER_ROLES, VITAL_RATINGS, VITAL_RATING_VALUES, VITAL_THRESHOLDS, VITAL_TYPES, VITAL_TYPE_VALUES, detectDeploymentContext, getApiRoute, getEnvVarNames, getFrameworkPackage, getPlan, getPlanLimit, getVitalRating, isDeploymentSource, isEventType, isFormEventType, isFormFieldType, isNavigationType, isPlanFeatureEnabled, isSdkEventType, isUsageCritical, isUsageWarning, isValidFramework, isVitalRating, isVitalType, normalizeDeploymentSource };
716
- //# sourceMappingURL=index.js.map