@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,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rejourney - Session Recording and Replay SDK for React Native
|
|
3
|
+
*
|
|
4
|
+
* Captures user interactions, gestures, and screen states for replay and analysis.
|
|
5
|
+
*
|
|
6
|
+
* Just call initRejourney() - everything else is automatic!
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) 2026 Rejourney
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* See LICENSE-APACHE for full terms.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { initRejourney } from 'rejourney';
|
|
17
|
+
*
|
|
18
|
+
* // Initialize the SDK with your public key - that's it!
|
|
19
|
+
* initRejourney('pk_live_xxxxxxxxxxxx');
|
|
20
|
+
*
|
|
21
|
+
* // Or with options:
|
|
22
|
+
* initRejourney('pk_live_xxxxxxxxxxxx', { debug: true });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import type { RejourneyConfig, RejourneyAPI } from './types';
|
|
26
|
+
/**
|
|
27
|
+
* Main Rejourney API (Internal)
|
|
28
|
+
*/
|
|
29
|
+
declare const Rejourney: RejourneyAPI;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize Rejourney SDK - STEP 1 of 3
|
|
32
|
+
*
|
|
33
|
+
* This sets up the SDK, handles attestation, and prepares for recording,
|
|
34
|
+
* but does NOT start recording automatically. Call startRejourney() after
|
|
35
|
+
* obtaining user consent to begin recording.
|
|
36
|
+
*
|
|
37
|
+
* @param publicRouteKey - Your public route key from the Rejourney dashboard
|
|
38
|
+
* @param options - Optional configuration options
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* import { initRejourney, startRejourney } from 'rejourney';
|
|
43
|
+
*
|
|
44
|
+
* // Step 1: Initialize SDK (safe to call on app start)
|
|
45
|
+
* initRejourney('pk_live_xxxxxxxxxxxx');
|
|
46
|
+
*
|
|
47
|
+
* // Step 2: After obtaining user consent
|
|
48
|
+
* startRejourney();
|
|
49
|
+
*
|
|
50
|
+
* // With options
|
|
51
|
+
* initRejourney('pk_live_xxxxxxxxxxxx', {
|
|
52
|
+
* debug: true,
|
|
53
|
+
* apiUrl: 'https://api.yourdomain.com',
|
|
54
|
+
* projectId: 'your-project-id',
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function initRejourney(publicRouteKey: string, options?: Omit<RejourneyConfig, 'publicRouteKey'>): void;
|
|
59
|
+
/**
|
|
60
|
+
* Start recording - STEP 2 of 3 (call after user consent)
|
|
61
|
+
*
|
|
62
|
+
* Begins session recording. Call this after obtaining user consent for recording.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { initRejourney, startRejourney } from 'rejourney';
|
|
67
|
+
*
|
|
68
|
+
* initRejourney('pk_live_xxxxxxxxxxxx');
|
|
69
|
+
*
|
|
70
|
+
* // After user accepts consent dialog
|
|
71
|
+
* startRejourney();
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function startRejourney(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Stop recording and cleanup all resources.
|
|
77
|
+
*
|
|
78
|
+
* Note: This is usually not needed as the SDK handles cleanup automatically.
|
|
79
|
+
* Only call this if you want to explicitly stop recording.
|
|
80
|
+
*/
|
|
81
|
+
export declare function stopRejourney(): void;
|
|
82
|
+
export default Rejourney;
|
|
83
|
+
export * from './types';
|
|
84
|
+
export { trackTap, trackScroll, trackGesture, trackInput, trackScreen, captureError, getSessionMetrics, } from './sdk/autoTracking';
|
|
85
|
+
export { trackNavigationState, useNavigationTracking } from './sdk/autoTracking';
|
|
86
|
+
export { LogLevel } from './sdk/utils';
|
|
87
|
+
/**
|
|
88
|
+
* Configure SDK log verbosity.
|
|
89
|
+
*
|
|
90
|
+
* By default, the SDK logs minimally to avoid polluting your app's console:
|
|
91
|
+
* - Production/Release: SILENT (no logs at all)
|
|
92
|
+
* - Development/Debug: Only critical errors shown
|
|
93
|
+
*
|
|
94
|
+
* Essential lifecycle events (init success, session start/end) are automatically
|
|
95
|
+
* logged in debug builds only - you don't need to configure anything.
|
|
96
|
+
*
|
|
97
|
+
* Use this function only if you need to troubleshoot SDK behavior.
|
|
98
|
+
*
|
|
99
|
+
* @param level - Minimum log level to display
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* import { setLogLevel, LogLevel } from 'rejourney';
|
|
104
|
+
*
|
|
105
|
+
* // Enable verbose logging for SDK debugging (not recommended for regular use)
|
|
106
|
+
* setLogLevel(LogLevel.DEBUG);
|
|
107
|
+
*
|
|
108
|
+
* // Show warnings and errors (for troubleshooting)
|
|
109
|
+
* setLogLevel(LogLevel.WARNING);
|
|
110
|
+
*
|
|
111
|
+
* // Silence all logs (default behavior in production)
|
|
112
|
+
* setLogLevel(LogLevel.SILENT);
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function setLogLevel(level: number): void;
|
|
116
|
+
export { Mask } from './components/Mask';
|
|
117
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,226 @@
|
|
|
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 Auto Tracking Module
|
|
18
|
+
*
|
|
19
|
+
* Automatic tracking features that work with just init() - no additional code needed.
|
|
20
|
+
* This module handles:
|
|
21
|
+
* - Rage tap detection
|
|
22
|
+
* - Error tracking (JS + React Native)
|
|
23
|
+
* - Session metrics aggregation
|
|
24
|
+
* - Device info collection
|
|
25
|
+
* - Anonymous ID generation
|
|
26
|
+
* - Funnel/screen tracking
|
|
27
|
+
* - Score calculations
|
|
28
|
+
*
|
|
29
|
+
* IMPORTANT: This file uses lazy loading for react-native imports to avoid
|
|
30
|
+
* "PlatformConstants could not be found" errors on RN 0.81+.
|
|
31
|
+
*/
|
|
32
|
+
import type { DeviceInfo, ErrorEvent } from '../types';
|
|
33
|
+
export interface TapEvent {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
targetId?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SessionMetrics {
|
|
40
|
+
totalEvents: number;
|
|
41
|
+
touchCount: number;
|
|
42
|
+
scrollCount: number;
|
|
43
|
+
gestureCount: number;
|
|
44
|
+
inputCount: number;
|
|
45
|
+
navigationCount: number;
|
|
46
|
+
errorCount: number;
|
|
47
|
+
rageTapCount: number;
|
|
48
|
+
deadTapCount: number;
|
|
49
|
+
apiSuccessCount: number;
|
|
50
|
+
apiErrorCount: number;
|
|
51
|
+
apiTotalCount: number;
|
|
52
|
+
netTotalDurationMs: number;
|
|
53
|
+
netTotalBytes: number;
|
|
54
|
+
screensVisited: string[];
|
|
55
|
+
uniqueScreensCount: number;
|
|
56
|
+
interactionScore: number;
|
|
57
|
+
explorationScore: number;
|
|
58
|
+
uxScore: number;
|
|
59
|
+
}
|
|
60
|
+
export interface AutoTrackingConfig {
|
|
61
|
+
rageTapThreshold?: number;
|
|
62
|
+
rageTapTimeWindow?: number;
|
|
63
|
+
rageTapRadius?: number;
|
|
64
|
+
trackJSErrors?: boolean;
|
|
65
|
+
trackPromiseRejections?: boolean;
|
|
66
|
+
trackReactNativeErrors?: boolean;
|
|
67
|
+
collectDeviceInfo?: boolean;
|
|
68
|
+
maxSessionDurationMs?: number;
|
|
69
|
+
detectDeadTaps?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Mark a tap as handled.
|
|
73
|
+
* No-op — kept for API compatibility. Dead tap detection is now native-side.
|
|
74
|
+
*/
|
|
75
|
+
export declare function markTapHandled(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Initialize auto tracking features
|
|
78
|
+
* Called automatically by Rejourney.init() - no user action needed
|
|
79
|
+
*/
|
|
80
|
+
export declare function initAutoTracking(trackingConfig: AutoTrackingConfig, callbacks?: {
|
|
81
|
+
onRageTap?: (count: number, x: number, y: number) => void;
|
|
82
|
+
onError?: (error: ErrorEvent) => void;
|
|
83
|
+
onScreen?: (screenName: string, previousScreen?: string) => void;
|
|
84
|
+
}): void;
|
|
85
|
+
/**
|
|
86
|
+
* Cleanup auto tracking features
|
|
87
|
+
*/
|
|
88
|
+
export declare function cleanupAutoTracking(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Track a tap event for rage tap detection
|
|
91
|
+
* Called automatically from touch interceptor
|
|
92
|
+
*/
|
|
93
|
+
export declare function trackTap(tap: TapEvent): void;
|
|
94
|
+
/**
|
|
95
|
+
* Notify that a state change occurred (navigation, modal, etc.)
|
|
96
|
+
* Kept for API compatibility
|
|
97
|
+
*/
|
|
98
|
+
export declare function notifyStateChange(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Manually track an error (for API errors, etc.)
|
|
101
|
+
*/
|
|
102
|
+
export declare function captureError(message: string, stack?: string, name?: string): void;
|
|
103
|
+
/**
|
|
104
|
+
* Track a navigation state change from React Navigation.
|
|
105
|
+
*
|
|
106
|
+
* For bare React Native apps using @react-navigation/native.
|
|
107
|
+
* Just add this to your NavigationContainer's onStateChange prop.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```tsx
|
|
111
|
+
* import { trackNavigationState } from 'rejourney';
|
|
112
|
+
*
|
|
113
|
+
* <NavigationContainer onStateChange={trackNavigationState}>
|
|
114
|
+
* ...
|
|
115
|
+
* </NavigationContainer>
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export declare function trackNavigationState(state: any): void;
|
|
119
|
+
/**
|
|
120
|
+
* React hook for navigation tracking.
|
|
121
|
+
*
|
|
122
|
+
* Returns props to spread on NavigationContainer that will:
|
|
123
|
+
* 1. Track the initial screen on mount (via onReady)
|
|
124
|
+
* 2. Track all subsequent navigations (via onStateChange)
|
|
125
|
+
*
|
|
126
|
+
* This is the RECOMMENDED approach for bare React Native apps.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* import { useNavigationTracking } from 'rejourney';
|
|
131
|
+
* import { NavigationContainer } from '@react-navigation/native';
|
|
132
|
+
*
|
|
133
|
+
* function App() {
|
|
134
|
+
* const navigationTracking = useNavigationTracking();
|
|
135
|
+
*
|
|
136
|
+
* return (
|
|
137
|
+
* <NavigationContainer {...navigationTracking}>
|
|
138
|
+
* <RootNavigator />
|
|
139
|
+
* </NavigationContainer>
|
|
140
|
+
* );
|
|
141
|
+
* }
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare function useNavigationTracking(): {
|
|
145
|
+
ref: any;
|
|
146
|
+
onReady: any;
|
|
147
|
+
onStateChange: typeof trackNavigationState;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Track a screen view
|
|
151
|
+
* This updates JS metrics AND notifies the native module to send to backend
|
|
152
|
+
*/
|
|
153
|
+
export declare function trackScreen(screenName: string): void;
|
|
154
|
+
/**
|
|
155
|
+
* Track an API request with timing data
|
|
156
|
+
*/
|
|
157
|
+
export declare function trackAPIRequest(success: boolean, _statusCode: number, durationMs?: number, responseBytes?: number): void;
|
|
158
|
+
/**
|
|
159
|
+
* Track a scroll event
|
|
160
|
+
*/
|
|
161
|
+
export declare function trackScroll(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Track a gesture event
|
|
164
|
+
*/
|
|
165
|
+
export declare function trackGesture(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Track an input event (keyboard)
|
|
168
|
+
*/
|
|
169
|
+
export declare function trackInput(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Get current session metrics
|
|
172
|
+
*/
|
|
173
|
+
export declare function getSessionMetrics(): SessionMetrics & {
|
|
174
|
+
netAvgDurationMs: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Reset metrics for new session
|
|
178
|
+
*/
|
|
179
|
+
export declare function resetMetrics(): void;
|
|
180
|
+
export declare function setMaxSessionDurationMinutes(minutes?: number): void;
|
|
181
|
+
export declare function hasExceededMaxSessionDuration(): boolean;
|
|
182
|
+
export declare function getRemainingSessionDurationMs(): number;
|
|
183
|
+
/**
|
|
184
|
+
* Collect device information
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* Collect device information
|
|
188
|
+
*/
|
|
189
|
+
export declare function collectDeviceInfo(): Promise<DeviceInfo>;
|
|
190
|
+
/**
|
|
191
|
+
* Get the anonymous ID (synchronous - returns generated ID immediately)
|
|
192
|
+
*/
|
|
193
|
+
export declare function getAnonymousId(): string;
|
|
194
|
+
/**
|
|
195
|
+
* Ensure a stable, persisted anonymous/device ID is available.
|
|
196
|
+
* Returns the stored ID if present, otherwise generates and persists one.
|
|
197
|
+
*/
|
|
198
|
+
export declare function ensurePersistentAnonymousId(): Promise<string>;
|
|
199
|
+
/**
|
|
200
|
+
* Load anonymous ID from persistent storage
|
|
201
|
+
* Call this at app startup for best results
|
|
202
|
+
*/
|
|
203
|
+
export declare function loadAnonymousId(): Promise<string>;
|
|
204
|
+
/**
|
|
205
|
+
* Set a custom anonymous ID
|
|
206
|
+
*/
|
|
207
|
+
export declare function setAnonymousId(id: string): void;
|
|
208
|
+
declare const _default: {
|
|
209
|
+
init: typeof initAutoTracking;
|
|
210
|
+
cleanup: typeof cleanupAutoTracking;
|
|
211
|
+
trackTap: typeof trackTap;
|
|
212
|
+
trackScroll: typeof trackScroll;
|
|
213
|
+
trackGesture: typeof trackGesture;
|
|
214
|
+
trackInput: typeof trackInput;
|
|
215
|
+
trackScreen: typeof trackScreen;
|
|
216
|
+
trackAPIRequest: typeof trackAPIRequest;
|
|
217
|
+
captureError: typeof captureError;
|
|
218
|
+
getMetrics: typeof getSessionMetrics;
|
|
219
|
+
resetMetrics: typeof resetMetrics;
|
|
220
|
+
collectDeviceInfo: typeof collectDeviceInfo;
|
|
221
|
+
getAnonymousId: typeof getAnonymousId;
|
|
222
|
+
setAnonymousId: typeof setAnonymousId;
|
|
223
|
+
markTapHandled: typeof markTapHandled;
|
|
224
|
+
};
|
|
225
|
+
export default _default;
|
|
226
|
+
//# sourceMappingURL=autoTracking.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
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 SDK Constants
|
|
18
|
+
*/
|
|
19
|
+
import { SDK_VERSION } from './version';
|
|
20
|
+
export { SDK_VERSION };
|
|
21
|
+
/** Default configuration values */
|
|
22
|
+
export declare const DEFAULT_CONFIG: {
|
|
23
|
+
readonly enabled: true;
|
|
24
|
+
readonly captureFPS: 0.5;
|
|
25
|
+
readonly captureOnEvents: true;
|
|
26
|
+
readonly maxSessionDuration: number;
|
|
27
|
+
readonly maxStorageSize: number;
|
|
28
|
+
readonly autoScreenTracking: true;
|
|
29
|
+
readonly autoGestureTracking: true;
|
|
30
|
+
readonly privacyOcclusion: true;
|
|
31
|
+
readonly enableCompression: true;
|
|
32
|
+
readonly inactivityThreshold: 5000;
|
|
33
|
+
readonly disableInDev: false;
|
|
34
|
+
readonly detectRageTaps: true;
|
|
35
|
+
readonly detectDeadTaps: true;
|
|
36
|
+
readonly rageTapThreshold: 3;
|
|
37
|
+
readonly rageTapTimeWindow: 1000;
|
|
38
|
+
readonly debug: false;
|
|
39
|
+
readonly autoStartRecording: true;
|
|
40
|
+
readonly collectDeviceInfo: true;
|
|
41
|
+
readonly collectGeoLocation: true;
|
|
42
|
+
readonly postNavigationDelay: 300;
|
|
43
|
+
readonly postGestureDelay: 200;
|
|
44
|
+
readonly postModalDelay: 400;
|
|
45
|
+
};
|
|
46
|
+
/** Event type constants */
|
|
47
|
+
export declare const EVENT_TYPES: {
|
|
48
|
+
readonly GESTURE: "gesture";
|
|
49
|
+
readonly SCREEN_CHANGE: "screen_change";
|
|
50
|
+
readonly CUSTOM: "custom";
|
|
51
|
+
readonly APP_STATE: "app_state";
|
|
52
|
+
readonly FRUSTRATION: "frustration";
|
|
53
|
+
readonly ERROR: "error";
|
|
54
|
+
};
|
|
55
|
+
/** Gesture type constants */
|
|
56
|
+
export declare const GESTURE_TYPES: {
|
|
57
|
+
readonly TAP: "tap";
|
|
58
|
+
readonly DOUBLE_TAP: "double_tap";
|
|
59
|
+
readonly LONG_PRESS: "long_press";
|
|
60
|
+
readonly SWIPE_LEFT: "swipe_left";
|
|
61
|
+
readonly SWIPE_RIGHT: "swipe_right";
|
|
62
|
+
readonly SWIPE_UP: "swipe_up";
|
|
63
|
+
readonly SWIPE_DOWN: "swipe_down";
|
|
64
|
+
readonly PINCH: "pinch";
|
|
65
|
+
readonly SCROLL: "scroll";
|
|
66
|
+
readonly RAGE_TAP: "rage_tap";
|
|
67
|
+
readonly DEAD_TAP: "dead_tap";
|
|
68
|
+
};
|
|
69
|
+
/** Playback speeds */
|
|
70
|
+
export declare const PLAYBACK_SPEEDS: readonly [0.5, 1, 2, 4];
|
|
71
|
+
/** Capture settings */
|
|
72
|
+
export declare const CAPTURE_SETTINGS: {
|
|
73
|
+
readonly DEFAULT_FPS: 0.5;
|
|
74
|
+
readonly MIN_FPS: 0.1;
|
|
75
|
+
readonly MAX_FPS: 2;
|
|
76
|
+
readonly CAPTURE_SCALE: 0.25;
|
|
77
|
+
readonly MIN_CAPTURE_DELTA_TIME: 0.5;
|
|
78
|
+
};
|
|
79
|
+
/** Memory management settings */
|
|
80
|
+
export declare const MEMORY_SETTINGS: {
|
|
81
|
+
/** Maximum events to keep in memory before flushing */
|
|
82
|
+
readonly MAX_EVENTS_IN_MEMORY: 100;
|
|
83
|
+
/** Memory warning threshold in MB (flush when exceeded) */
|
|
84
|
+
readonly MEMORY_WARNING_THRESHOLD_MB: 100;
|
|
85
|
+
/** Enable aggressive memory cleanup during low memory */
|
|
86
|
+
readonly AGGRESSIVE_CLEANUP_ENABLED: true;
|
|
87
|
+
/** Bitmap pool size for reusing bitmaps (Android) */
|
|
88
|
+
readonly BITMAP_POOL_SIZE: 3;
|
|
89
|
+
};
|
|
90
|
+
/** CPU throttling settings */
|
|
91
|
+
export declare const CPU_SETTINGS: {
|
|
92
|
+
/** Throttle captures when CPU usage exceeds this percentage */
|
|
93
|
+
readonly CPU_THROTTLE_THRESHOLD: 80;
|
|
94
|
+
/** Minimum interval between captures when throttled (seconds) */
|
|
95
|
+
readonly THROTTLED_MIN_INTERVAL: 2;
|
|
96
|
+
/** Skip captures when battery is below this level (0-100) */
|
|
97
|
+
readonly LOW_BATTERY_THRESHOLD: 15;
|
|
98
|
+
/** Skip captures when device is thermally throttled */
|
|
99
|
+
readonly THERMAL_THROTTLE_ENABLED: true;
|
|
100
|
+
/** Maximum consecutive captures before forced cooldown */
|
|
101
|
+
readonly MAX_CONSECUTIVE_CAPTURES: 10;
|
|
102
|
+
/** Cooldown period after max consecutive captures (ms) */
|
|
103
|
+
readonly CAPTURE_COOLDOWN_MS: 1000;
|
|
104
|
+
};
|
|
105
|
+
/** Storage management settings */
|
|
106
|
+
export declare const STORAGE_SETTINGS: {
|
|
107
|
+
/** Maximum total storage for session data (bytes) */
|
|
108
|
+
readonly MAX_STORAGE_SIZE: number;
|
|
109
|
+
/** Storage warning threshold - start cleanup at this level */
|
|
110
|
+
readonly STORAGE_WARNING_THRESHOLD: 0.8;
|
|
111
|
+
/** Number of old sessions to keep */
|
|
112
|
+
readonly MAX_SESSIONS_TO_KEEP: 5;
|
|
113
|
+
/** Auto-delete sessions older than this (hours) */
|
|
114
|
+
readonly SESSION_EXPIRY_HOURS: 24;
|
|
115
|
+
/** Use efficient binary storage format */
|
|
116
|
+
readonly USE_BINARY_FORMAT: true;
|
|
117
|
+
};
|
|
118
|
+
/** Network/Upload settings */
|
|
119
|
+
export declare const UPLOAD_SETTINGS: {
|
|
120
|
+
/** Batch upload interval (ms) */
|
|
121
|
+
readonly BATCH_INTERVAL_MS: 30000;
|
|
122
|
+
/** Max retry attempts for failed uploads */
|
|
123
|
+
readonly MAX_RETRY_ATTEMPTS: 3;
|
|
124
|
+
/** Retry delay multiplier (exponential backoff) */
|
|
125
|
+
readonly RETRY_DELAY_MULTIPLIER: 2;
|
|
126
|
+
/** Initial retry delay (ms) */
|
|
127
|
+
readonly INITIAL_RETRY_DELAY_MS: 1000;
|
|
128
|
+
/** Max events per upload batch */
|
|
129
|
+
readonly MAX_EVENTS_PER_BATCH: 50;
|
|
130
|
+
/** Skip uploads when on cellular and battery is low */
|
|
131
|
+
readonly CELLULAR_BATTERY_AWARE: true;
|
|
132
|
+
};
|
|
133
|
+
/** Privacy constants */
|
|
134
|
+
export declare const PRIVACY: {
|
|
135
|
+
readonly OCCLUSION_COLOR: "#808080";
|
|
136
|
+
readonly SENSITIVE_COMPONENT_TYPES: readonly ["TextInput", "SecureTextEntry", "PasswordField"];
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
* Error Tracking Module for Rejourney SDK
|
|
18
|
+
*
|
|
19
|
+
* Handles JS error capture, React Native ErrorUtils, and unhandled promise rejections.
|
|
20
|
+
* Split from autoTracking.ts for better code organization.
|
|
21
|
+
*/
|
|
22
|
+
import type { ErrorEvent } from '../types';
|
|
23
|
+
/**
|
|
24
|
+
* Setup error tracking with the given callback
|
|
25
|
+
*/
|
|
26
|
+
export declare function setupErrorTracking(config: {
|
|
27
|
+
trackJSErrors?: boolean;
|
|
28
|
+
trackPromiseRejections?: boolean;
|
|
29
|
+
trackReactNativeErrors?: boolean;
|
|
30
|
+
}, onError: (error: ErrorEvent) => void): void;
|
|
31
|
+
/**
|
|
32
|
+
* Cleanup error tracking and restore original handlers
|
|
33
|
+
*/
|
|
34
|
+
export declare function cleanupErrorTracking(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get current error count
|
|
37
|
+
*/
|
|
38
|
+
export declare function getErrorCount(): number;
|
|
39
|
+
/**
|
|
40
|
+
* Reset error count
|
|
41
|
+
*/
|
|
42
|
+
export declare function resetErrorCount(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Manually capture an error
|
|
45
|
+
*/
|
|
46
|
+
export declare function captureError(message: string, stack?: string, name?: string): void;
|
|
47
|
+
//# sourceMappingURL=errorTracking.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
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 SDK
|
|
18
|
+
* Session recording and replay for React Native
|
|
19
|
+
*/
|
|
20
|
+
export * from './constants';
|
|
21
|
+
export * from './utils';
|
|
22
|
+
export * from './autoTracking';
|
|
23
|
+
export * from './networkInterceptor';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
* Session Metrics Module for Rejourney SDK
|
|
18
|
+
*
|
|
19
|
+
* Tracks and calculates session metrics including interaction scores,
|
|
20
|
+
* API performance, and user engagement metrics.
|
|
21
|
+
* Split from autoTracking.ts for better code organization.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Session metrics structure
|
|
25
|
+
*/
|
|
26
|
+
export interface SessionMetrics {
|
|
27
|
+
totalEvents: number;
|
|
28
|
+
touchCount: number;
|
|
29
|
+
scrollCount: number;
|
|
30
|
+
gestureCount: number;
|
|
31
|
+
inputCount: number;
|
|
32
|
+
navigationCount: number;
|
|
33
|
+
errorCount: number;
|
|
34
|
+
rageTapCount: number;
|
|
35
|
+
deadTapCount: number;
|
|
36
|
+
apiSuccessCount: number;
|
|
37
|
+
apiErrorCount: number;
|
|
38
|
+
apiTotalCount: number;
|
|
39
|
+
netTotalDurationMs: number;
|
|
40
|
+
netTotalBytes: number;
|
|
41
|
+
screensVisited: string[];
|
|
42
|
+
uniqueScreensCount: number;
|
|
43
|
+
interactionScore: number;
|
|
44
|
+
explorationScore: number;
|
|
45
|
+
uxScore: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create empty metrics object
|
|
49
|
+
*/
|
|
50
|
+
export declare function createEmptyMetrics(): SessionMetrics;
|
|
51
|
+
/**
|
|
52
|
+
* Reset all metrics
|
|
53
|
+
*/
|
|
54
|
+
export declare function resetMetrics(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Initialize metrics for new session
|
|
57
|
+
*/
|
|
58
|
+
export declare function initMetrics(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Get current session metrics with calculated scores
|
|
61
|
+
*/
|
|
62
|
+
export declare function getSessionMetrics(): SessionMetrics;
|
|
63
|
+
/**
|
|
64
|
+
* Set max session duration (in minutes)
|
|
65
|
+
*/
|
|
66
|
+
export declare function setMaxSessionDurationMinutes(minutes?: number): void;
|
|
67
|
+
export declare function incrementTouchCount(): void;
|
|
68
|
+
export declare function incrementScrollCount(): void;
|
|
69
|
+
export declare function incrementNavigationCount(): void;
|
|
70
|
+
export declare function incrementRageTapCount(): void;
|
|
71
|
+
export declare function incrementDeadTapCount(): void;
|
|
72
|
+
export declare function incrementErrorCount(): void;
|
|
73
|
+
export declare function addScreenVisited(screenName: string): void;
|
|
74
|
+
export declare function trackAPIMetrics(success: boolean, durationMs?: number, responseBytes?: number): void;
|
|
75
|
+
//# sourceMappingURL=metricsTracking.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
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 Navigation Utilities
|
|
18
|
+
*
|
|
19
|
+
* Helper functions for extracting human-readable screen names from
|
|
20
|
+
* React Navigation / Expo Router state.
|
|
21
|
+
*
|
|
22
|
+
* These functions are used internally by the SDK's automatic navigation
|
|
23
|
+
* detection. You don't need to import or use these directly.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Normalize a screen name to be human-readable
|
|
27
|
+
* Handles common patterns from React Native / Expo Router
|
|
28
|
+
*
|
|
29
|
+
* @param raw - Raw screen name to normalize
|
|
30
|
+
* @returns Cleaned, human-readable screen name
|
|
31
|
+
*/
|
|
32
|
+
export declare function normalizeScreenName(raw: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get a human-readable screen name from Expo Router path and segments
|
|
35
|
+
*
|
|
36
|
+
* @param pathname - The current route pathname
|
|
37
|
+
* @param segments - Route segments from useSegments()
|
|
38
|
+
* @returns Human-readable screen name
|
|
39
|
+
*/
|
|
40
|
+
export declare function getScreenNameFromPath(pathname: string, segments: string[]): string;
|
|
41
|
+
/**
|
|
42
|
+
* Get the current route name from a navigation state object
|
|
43
|
+
*
|
|
44
|
+
* @param state - React Navigation state object
|
|
45
|
+
* @returns Current route name or null
|
|
46
|
+
*/
|
|
47
|
+
export declare function getCurrentRouteFromState(state: any): string | null;
|
|
48
|
+
//# sourceMappingURL=navigation.d.ts.map
|