@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.
- package/README.md +29 -0
- package/android/build.gradle.kts +135 -0
- package/android/consumer-rules.pro +10 -0
- package/android/proguard-rules.pro +1 -0
- package/android/src/main/AndroidManifest.xml +15 -0
- package/android/src/main/java/com/rejourney/RejourneyModuleImpl.kt +860 -0
- package/android/src/main/java/com/rejourney/engine/DeviceRegistrar.kt +290 -0
- package/android/src/main/java/com/rejourney/engine/DiagnosticLog.kt +385 -0
- package/android/src/main/java/com/rejourney/engine/RejourneyImpl.kt +512 -0
- package/android/src/main/java/com/rejourney/platform/OEMDetector.kt +173 -0
- package/android/src/main/java/com/rejourney/platform/PerfTiming.kt +384 -0
- package/android/src/main/java/com/rejourney/platform/SessionLifecycleService.kt +160 -0
- package/android/src/main/java/com/rejourney/platform/Telemetry.kt +301 -0
- package/android/src/main/java/com/rejourney/platform/WindowUtils.kt +100 -0
- package/android/src/main/java/com/rejourney/recording/AnrSentinel.kt +129 -0
- package/android/src/main/java/com/rejourney/recording/EventBuffer.kt +330 -0
- package/android/src/main/java/com/rejourney/recording/InteractionRecorder.kt +519 -0
- package/android/src/main/java/com/rejourney/recording/ReplayOrchestrator.kt +740 -0
- package/android/src/main/java/com/rejourney/recording/SegmentDispatcher.kt +559 -0
- package/android/src/main/java/com/rejourney/recording/StabilityMonitor.kt +238 -0
- package/android/src/main/java/com/rejourney/recording/TelemetryPipeline.kt +633 -0
- package/android/src/main/java/com/rejourney/recording/ViewHierarchyScanner.kt +232 -0
- package/android/src/main/java/com/rejourney/recording/VisualCapture.kt +474 -0
- package/android/src/main/java/com/rejourney/utility/DataCompression.kt +63 -0
- package/android/src/main/java/com/rejourney/utility/ImageBlur.kt +412 -0
- package/android/src/main/java/com/rejourney/utility/ViewIdentifier.kt +169 -0
- package/android/src/newarch/java/com/rejourney/RejourneyModule.kt +232 -0
- package/android/src/newarch/java/com/rejourney/RejourneyPackage.kt +40 -0
- package/android/src/oldarch/java/com/rejourney/RejourneyModule.kt +268 -0
- package/android/src/oldarch/java/com/rejourney/RejourneyPackage.kt +23 -0
- package/ios/Engine/DeviceRegistrar.swift +288 -0
- package/ios/Engine/DiagnosticLog.swift +387 -0
- package/ios/Engine/RejourneyImpl.swift +719 -0
- package/ios/Recording/AnrSentinel.swift +142 -0
- package/ios/Recording/EventBuffer.swift +326 -0
- package/ios/Recording/InteractionRecorder.swift +428 -0
- package/ios/Recording/ReplayOrchestrator.swift +624 -0
- package/ios/Recording/SegmentDispatcher.swift +492 -0
- package/ios/Recording/StabilityMonitor.swift +223 -0
- package/ios/Recording/TelemetryPipeline.swift +547 -0
- package/ios/Recording/ViewHierarchyScanner.swift +156 -0
- package/ios/Recording/VisualCapture.swift +675 -0
- package/ios/Rejourney.h +38 -0
- package/ios/Rejourney.mm +375 -0
- package/ios/Utility/DataCompression.swift +55 -0
- package/ios/Utility/ImageBlur.swift +89 -0
- package/ios/Utility/RuntimeMethodSwap.swift +41 -0
- package/ios/Utility/ViewIdentifier.swift +37 -0
- package/lib/commonjs/NativeRejourney.js +40 -0
- package/lib/commonjs/components/Mask.js +88 -0
- package/lib/commonjs/index.js +1443 -0
- package/lib/commonjs/sdk/autoTracking.js +1087 -0
- package/lib/commonjs/sdk/constants.js +166 -0
- package/lib/commonjs/sdk/errorTracking.js +187 -0
- package/lib/commonjs/sdk/index.js +50 -0
- package/lib/commonjs/sdk/metricsTracking.js +205 -0
- package/lib/commonjs/sdk/navigation.js +128 -0
- package/lib/commonjs/sdk/networkInterceptor.js +375 -0
- package/lib/commonjs/sdk/utils.js +433 -0
- package/lib/commonjs/sdk/version.js +13 -0
- package/lib/commonjs/types/expo-router.d.js +2 -0
- package/lib/commonjs/types/index.js +2 -0
- package/lib/module/NativeRejourney.js +38 -0
- package/lib/module/components/Mask.js +83 -0
- package/lib/module/index.js +1341 -0
- package/lib/module/sdk/autoTracking.js +1059 -0
- package/lib/module/sdk/constants.js +154 -0
- package/lib/module/sdk/errorTracking.js +177 -0
- package/lib/module/sdk/index.js +26 -0
- package/lib/module/sdk/metricsTracking.js +187 -0
- package/lib/module/sdk/navigation.js +120 -0
- package/lib/module/sdk/networkInterceptor.js +364 -0
- package/lib/module/sdk/utils.js +412 -0
- package/lib/module/sdk/version.js +7 -0
- package/lib/module/types/expo-router.d.js +2 -0
- package/lib/module/types/index.js +2 -0
- package/lib/typescript/NativeRejourney.d.ts +160 -0
- package/lib/typescript/components/Mask.d.ts +54 -0
- package/lib/typescript/index.d.ts +117 -0
- package/lib/typescript/sdk/autoTracking.d.ts +226 -0
- package/lib/typescript/sdk/constants.d.ts +138 -0
- package/lib/typescript/sdk/errorTracking.d.ts +47 -0
- package/lib/typescript/sdk/index.d.ts +24 -0
- package/lib/typescript/sdk/metricsTracking.d.ts +75 -0
- package/lib/typescript/sdk/navigation.d.ts +48 -0
- package/lib/typescript/sdk/networkInterceptor.d.ts +62 -0
- package/lib/typescript/sdk/utils.d.ts +193 -0
- package/lib/typescript/sdk/version.d.ts +6 -0
- package/lib/typescript/types/index.d.ts +618 -0
- package/package.json +122 -0
- package/rejourney.podspec +23 -0
- package/src/NativeRejourney.ts +185 -0
- package/src/components/Mask.tsx +93 -0
- package/src/index.ts +1555 -0
- package/src/sdk/autoTracking.ts +1245 -0
- package/src/sdk/constants.ts +155 -0
- package/src/sdk/errorTracking.ts +231 -0
- package/src/sdk/index.ts +25 -0
- package/src/sdk/metricsTracking.ts +227 -0
- package/src/sdk/navigation.ts +152 -0
- package/src/sdk/networkInterceptor.ts +423 -0
- package/src/sdk/utils.ts +442 -0
- package/src/sdk/version.ts +6 -0
- package/src/types/expo-router.d.ts +7 -0
- 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
|