@rejourneyco/react-native 1.0.7

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.
Files changed (105) hide show
  1. package/README.md +29 -0
  2. package/android/build.gradle.kts +135 -0
  3. package/android/consumer-rules.pro +10 -0
  4. package/android/proguard-rules.pro +1 -0
  5. package/android/src/main/AndroidManifest.xml +15 -0
  6. package/android/src/main/java/com/rejourney/RejourneyModuleImpl.kt +860 -0
  7. package/android/src/main/java/com/rejourney/engine/DeviceRegistrar.kt +290 -0
  8. package/android/src/main/java/com/rejourney/engine/DiagnosticLog.kt +385 -0
  9. package/android/src/main/java/com/rejourney/engine/RejourneyImpl.kt +512 -0
  10. package/android/src/main/java/com/rejourney/platform/OEMDetector.kt +173 -0
  11. package/android/src/main/java/com/rejourney/platform/PerfTiming.kt +384 -0
  12. package/android/src/main/java/com/rejourney/platform/SessionLifecycleService.kt +160 -0
  13. package/android/src/main/java/com/rejourney/platform/Telemetry.kt +301 -0
  14. package/android/src/main/java/com/rejourney/platform/WindowUtils.kt +100 -0
  15. package/android/src/main/java/com/rejourney/recording/AnrSentinel.kt +129 -0
  16. package/android/src/main/java/com/rejourney/recording/EventBuffer.kt +330 -0
  17. package/android/src/main/java/com/rejourney/recording/InteractionRecorder.kt +519 -0
  18. package/android/src/main/java/com/rejourney/recording/ReplayOrchestrator.kt +740 -0
  19. package/android/src/main/java/com/rejourney/recording/SegmentDispatcher.kt +559 -0
  20. package/android/src/main/java/com/rejourney/recording/StabilityMonitor.kt +238 -0
  21. package/android/src/main/java/com/rejourney/recording/TelemetryPipeline.kt +633 -0
  22. package/android/src/main/java/com/rejourney/recording/ViewHierarchyScanner.kt +232 -0
  23. package/android/src/main/java/com/rejourney/recording/VisualCapture.kt +474 -0
  24. package/android/src/main/java/com/rejourney/utility/DataCompression.kt +63 -0
  25. package/android/src/main/java/com/rejourney/utility/ImageBlur.kt +412 -0
  26. package/android/src/main/java/com/rejourney/utility/ViewIdentifier.kt +169 -0
  27. package/android/src/newarch/java/com/rejourney/RejourneyModule.kt +232 -0
  28. package/android/src/newarch/java/com/rejourney/RejourneyPackage.kt +40 -0
  29. package/android/src/oldarch/java/com/rejourney/RejourneyModule.kt +268 -0
  30. package/android/src/oldarch/java/com/rejourney/RejourneyPackage.kt +23 -0
  31. package/ios/Engine/DeviceRegistrar.swift +288 -0
  32. package/ios/Engine/DiagnosticLog.swift +387 -0
  33. package/ios/Engine/RejourneyImpl.swift +719 -0
  34. package/ios/Recording/AnrSentinel.swift +142 -0
  35. package/ios/Recording/EventBuffer.swift +326 -0
  36. package/ios/Recording/InteractionRecorder.swift +428 -0
  37. package/ios/Recording/ReplayOrchestrator.swift +624 -0
  38. package/ios/Recording/SegmentDispatcher.swift +492 -0
  39. package/ios/Recording/StabilityMonitor.swift +223 -0
  40. package/ios/Recording/TelemetryPipeline.swift +547 -0
  41. package/ios/Recording/ViewHierarchyScanner.swift +156 -0
  42. package/ios/Recording/VisualCapture.swift +675 -0
  43. package/ios/Rejourney.h +38 -0
  44. package/ios/Rejourney.mm +375 -0
  45. package/ios/Utility/DataCompression.swift +55 -0
  46. package/ios/Utility/ImageBlur.swift +89 -0
  47. package/ios/Utility/RuntimeMethodSwap.swift +41 -0
  48. package/ios/Utility/ViewIdentifier.swift +37 -0
  49. package/lib/commonjs/NativeRejourney.js +40 -0
  50. package/lib/commonjs/components/Mask.js +88 -0
  51. package/lib/commonjs/index.js +1443 -0
  52. package/lib/commonjs/sdk/autoTracking.js +1087 -0
  53. package/lib/commonjs/sdk/constants.js +166 -0
  54. package/lib/commonjs/sdk/errorTracking.js +187 -0
  55. package/lib/commonjs/sdk/index.js +50 -0
  56. package/lib/commonjs/sdk/metricsTracking.js +205 -0
  57. package/lib/commonjs/sdk/navigation.js +128 -0
  58. package/lib/commonjs/sdk/networkInterceptor.js +375 -0
  59. package/lib/commonjs/sdk/utils.js +433 -0
  60. package/lib/commonjs/sdk/version.js +13 -0
  61. package/lib/commonjs/types/expo-router.d.js +2 -0
  62. package/lib/commonjs/types/index.js +2 -0
  63. package/lib/module/NativeRejourney.js +38 -0
  64. package/lib/module/components/Mask.js +83 -0
  65. package/lib/module/index.js +1341 -0
  66. package/lib/module/sdk/autoTracking.js +1059 -0
  67. package/lib/module/sdk/constants.js +154 -0
  68. package/lib/module/sdk/errorTracking.js +177 -0
  69. package/lib/module/sdk/index.js +26 -0
  70. package/lib/module/sdk/metricsTracking.js +187 -0
  71. package/lib/module/sdk/navigation.js +120 -0
  72. package/lib/module/sdk/networkInterceptor.js +364 -0
  73. package/lib/module/sdk/utils.js +412 -0
  74. package/lib/module/sdk/version.js +7 -0
  75. package/lib/module/types/expo-router.d.js +2 -0
  76. package/lib/module/types/index.js +2 -0
  77. package/lib/typescript/NativeRejourney.d.ts +160 -0
  78. package/lib/typescript/components/Mask.d.ts +54 -0
  79. package/lib/typescript/index.d.ts +117 -0
  80. package/lib/typescript/sdk/autoTracking.d.ts +226 -0
  81. package/lib/typescript/sdk/constants.d.ts +138 -0
  82. package/lib/typescript/sdk/errorTracking.d.ts +47 -0
  83. package/lib/typescript/sdk/index.d.ts +24 -0
  84. package/lib/typescript/sdk/metricsTracking.d.ts +75 -0
  85. package/lib/typescript/sdk/navigation.d.ts +48 -0
  86. package/lib/typescript/sdk/networkInterceptor.d.ts +62 -0
  87. package/lib/typescript/sdk/utils.d.ts +193 -0
  88. package/lib/typescript/sdk/version.d.ts +6 -0
  89. package/lib/typescript/types/index.d.ts +618 -0
  90. package/package.json +122 -0
  91. package/rejourney.podspec +23 -0
  92. package/src/NativeRejourney.ts +185 -0
  93. package/src/components/Mask.tsx +93 -0
  94. package/src/index.ts +1555 -0
  95. package/src/sdk/autoTracking.ts +1245 -0
  96. package/src/sdk/constants.ts +155 -0
  97. package/src/sdk/errorTracking.ts +231 -0
  98. package/src/sdk/index.ts +25 -0
  99. package/src/sdk/metricsTracking.ts +227 -0
  100. package/src/sdk/navigation.ts +152 -0
  101. package/src/sdk/networkInterceptor.ts +423 -0
  102. package/src/sdk/utils.ts +442 -0
  103. package/src/sdk/version.ts +6 -0
  104. package/src/types/expo-router.d.ts +7 -0
  105. package/src/types/index.ts +709 -0
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright 2026 Rejourney
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Network Interceptor for Rejourney - Optimized Version
18
+ *
19
+ * Automatically intercepts fetch() and XMLHttpRequest to log API calls.
20
+ *
21
+ * PERFORMANCE OPTIMIZATIONS:
22
+ * - Minimal synchronous overhead (just captures timing, no processing)
23
+ * - Batched async logging (doesn't block requests)
24
+ * - Circular buffer with max size limit
25
+ * - Sampling for high-frequency endpoints
26
+ * - No string allocations in hot path
27
+ * - Lazy URL parsing
28
+ * - PII Scrubbing for query parameters
29
+ */
30
+ import type { NetworkRequestParams } from '../types';
31
+ /**
32
+ * Initialize network interception
33
+ */
34
+ export declare function initNetworkInterceptor(callback: (request: NetworkRequestParams) => void, options?: {
35
+ ignoreUrls?: (string | RegExp)[];
36
+ captureSizes?: boolean;
37
+ }): void;
38
+ /**
39
+ * Disable network interception
40
+ */
41
+ export declare function disableNetworkInterceptor(): void;
42
+ /**
43
+ * Re-enable network interception
44
+ */
45
+ export declare function enableNetworkInterceptor(): void;
46
+ /**
47
+ * Force flush pending requests (call before app termination)
48
+ */
49
+ export declare function flushNetworkRequests(): void;
50
+ /**
51
+ * Restore original fetch and XHR
52
+ */
53
+ export declare function restoreNetworkInterceptor(): void;
54
+ /**
55
+ * Get stats for debugging
56
+ */
57
+ export declare function getNetworkInterceptorStats(): {
58
+ pendingCount: number;
59
+ endpointCount: number;
60
+ enabled: boolean;
61
+ };
62
+ //# sourceMappingURL=networkInterceptor.d.ts.map
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Copyright 2026 Rejourney
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Rejourney Utility Functions
18
+ *
19
+ * IMPORTANT: This file uses lazy loading for react-native imports to avoid
20
+ * "PlatformConstants could not be found" errors on RN 0.81+.
21
+ */
22
+ import type { TouchPoint, GestureType } from '../types';
23
+ /**
24
+ * Generate a unique ID
25
+ */
26
+ export declare function generateId(): string;
27
+ /**
28
+ * Generate a session ID
29
+ */
30
+ export declare function generateSessionId(): string;
31
+ /**
32
+ * Get current timestamp in milliseconds
33
+ */
34
+ export declare function now(): number;
35
+ /**
36
+ * Check if running in development mode
37
+ */
38
+ export declare function isDevelopment(): boolean;
39
+ /**
40
+ * Check platform
41
+ */
42
+ export declare function isIOS(): boolean;
43
+ export declare function isAndroid(): boolean;
44
+ /**
45
+ * Calculate distance between two points
46
+ */
47
+ export declare function distance(p1: TouchPoint, p2: TouchPoint): number;
48
+ /**
49
+ * Calculate velocity between two points
50
+ */
51
+ export declare function velocity(p1: TouchPoint, p2: TouchPoint): {
52
+ x: number;
53
+ y: number;
54
+ };
55
+ /**
56
+ * Determine gesture type from touch points
57
+ */
58
+ export declare function classifyGesture(touches: TouchPoint[], duration: number): GestureType;
59
+ /**
60
+ * Throttle function execution
61
+ */
62
+ export declare function throttle<T extends (...args: any[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
63
+ /**
64
+ * Debounce function execution
65
+ */
66
+ export declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
67
+ /**
68
+ * Format bytes to human readable string
69
+ */
70
+ export declare function formatBytes(bytes: number): string;
71
+ /**
72
+ * Format duration to human readable string
73
+ */
74
+ export declare function formatDuration(ms: number): string;
75
+ /**
76
+ * Format timestamp to readable time
77
+ */
78
+ export declare function formatTime(ms: number): string;
79
+ /**
80
+ * Create a simple hash of a string
81
+ */
82
+ export declare function simpleHash(str: string): string;
83
+ /**
84
+ * Log levels for controlling verbosity.
85
+ *
86
+ * Default behavior minimizes log pollution for integrators:
87
+ * - Release/Production: SILENT (no logs)
88
+ * - Development: ERROR (only critical issues)
89
+ */
90
+ export declare enum LogLevel {
91
+ DEBUG = 0,
92
+ INFO = 1,
93
+ WARNING = 2,
94
+ ERROR = 3,
95
+ SILENT = 4
96
+ }
97
+ /**
98
+ * Logger with production-aware log levels.
99
+ *
100
+ * Designed to minimize log pollution for integrators:
101
+ * - Production/Release: SILENT (completely silent, no logs)
102
+ * - Development/Debug: ERROR (only critical errors)
103
+ *
104
+ * Only essential lifecycle logs (init success, session start/end) bypass
105
+ * these levels via dedicated methods.
106
+ */
107
+ declare class Logger {
108
+ private prefix;
109
+ /**
110
+ * Minimum log level to display.
111
+ *
112
+ * Defaults to SILENT to avoid polluting integrator's console.
113
+ * SDK developers can adjust this for internal debugging.
114
+ *
115
+ * Note: In production builds, this should remain SILENT.
116
+ * The native layers handle build-type detection automatically.
117
+ */
118
+ private minimumLogLevel;
119
+ /**
120
+ * Set the minimum log level. Logs below this level will be suppressed.
121
+ * SDK developers can use this for internal debugging.
122
+ */
123
+ setLogLevel(level: LogLevel): void;
124
+ setDebugMode(enabled: boolean): void;
125
+ /** Log a debug message - SDK internal use only */
126
+ debug(...args: any[]): void;
127
+ /** Log an info message - SDK internal use only */
128
+ info(...args: any[]): void;
129
+ /** Log a warning message */
130
+ warn(...args: any[]): void;
131
+ /** Log an error message */
132
+ error(...args: any[]): void;
133
+ notice(...args: any[]): void;
134
+ /**
135
+ * Log SDK initialization success.
136
+ * Only shown in development builds - this is the minimal "SDK started" log.
137
+ */
138
+ logInitSuccess(version: string): void;
139
+ /**
140
+ * Log SDK initialization failure.
141
+ * Always shown - this is a critical error.
142
+ */
143
+ logInitFailure(reason: string): void;
144
+ /**
145
+ * Log session start.
146
+ * Only shown in development builds.
147
+ */
148
+ logSessionStart(sessionId: string): void;
149
+ /**
150
+ * Log session end.
151
+ * Only shown in development builds.
152
+ */
153
+ logSessionEnd(sessionId: string): void;
154
+ logObservabilityStart(): void;
155
+ logRecordingStart(): void;
156
+ logRecordingRemoteDisabled(): void;
157
+ logInvalidProjectKey(): void;
158
+ logPackageMismatch(): void;
159
+ /**
160
+ * Log network request details
161
+ */
162
+ logNetworkRequest(request: {
163
+ method?: string;
164
+ url?: string;
165
+ statusCode?: number;
166
+ duration?: number;
167
+ error?: string;
168
+ }): void;
169
+ /**
170
+ * Log frustration event (rage taps, etc)
171
+ */
172
+ logFrustration(kind: string): void;
173
+ /**
174
+ * Log error captured by SDK
175
+ */
176
+ logError(message: string): void;
177
+ /**
178
+ * Log lifecycle event (Background/Foreground)
179
+ * Visible in development builds.
180
+ */
181
+ logLifecycleEvent(event: string): void;
182
+ /**
183
+ * Log upload statistics
184
+ */
185
+ logUploadStats(metrics: {
186
+ uploadSuccessCount: number;
187
+ uploadFailureCount: number;
188
+ totalBytesUploaded: number;
189
+ }): void;
190
+ }
191
+ export declare const logger: Logger;
192
+ export {};
193
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Auto-generated file - DO NOT EDIT
3
+ * Generated by scripts/generate-version.js from package.json
4
+ */
5
+ export declare const SDK_VERSION = "1.0.7";
6
+ //# sourceMappingURL=version.d.ts.map