@mixpanel/react-native-session-replay 0.2.0 → 1.0.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/MixpanelReactNativeSessionReplay.podspec +1 -1
- package/README.md +2 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/mixpanelreactnativesessionreplay/MixpanelReactNativeSessionReplayModule.kt +21 -1
- package/ios/MixpanelReactNativeSessionReplay.mm +26 -1
- package/ios/MixpanelSwiftSessionReplay.swift +13 -1
- package/lib/module/NativeMixpanelReactNativeSessionReplay.js.map +1 -1
- package/lib/module/index.js +27 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeMixpanelReactNativeSessionReplay.d.ts +2 -0
- package/lib/typescript/src/NativeMixpanelReactNativeSessionReplay.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +20 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeMixpanelReactNativeSessionReplay.ts +2 -0
- package/src/index.tsx +26 -0
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
|
-
s.dependency 'MixpanelSessionReplay', '1.
|
|
18
|
+
s.dependency 'MixpanelSessionReplay', '1.2.0'
|
|
19
19
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
20
20
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
21
21
|
if respond_to?(:install_modules_dependencies, true)
|
package/README.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -79,7 +79,7 @@ dependencies {
|
|
|
79
79
|
implementation "com.mixpanel.android:mixpanel-android:8.0.2"
|
|
80
80
|
|
|
81
81
|
// Mixpanel Android Session Replay SDK dependency
|
|
82
|
-
implementation "com.mixpanel.android:mixpanel-android-session-replay:1.0.
|
|
82
|
+
implementation "com.mixpanel.android:mixpanel-android-session-replay:1.0.5"
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
react {
|
|
@@ -155,6 +155,26 @@ class MixpanelReactNativeSessionReplayModule(reactContext: ReactApplicationConte
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
@ReactMethod
|
|
159
|
+
override fun getReplayId(promise: Promise) {
|
|
160
|
+
try {
|
|
161
|
+
val replayId = MPSessionReplay.getInstance()?.getReplayId()
|
|
162
|
+
promise.resolve(replayId)
|
|
163
|
+
} catch (e: Exception) {
|
|
164
|
+
promise.reject("GET_REPLAY_ID_ERROR", e.message, e)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@ReactMethod
|
|
169
|
+
override fun flush(promise: Promise) {
|
|
170
|
+
try {
|
|
171
|
+
MPSessionReplay.getInstance()?.flush(onComplete = {
|
|
172
|
+
promise.resolve(null)
|
|
173
|
+
}) ?: promise.resolve(null)
|
|
174
|
+
} catch (e: Exception) {
|
|
175
|
+
promise.resolve(null)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
158
178
|
|
|
159
179
|
/**
|
|
160
180
|
* Safely configure sensitive classes for comprehensive React Native view masking
|
|
@@ -287,7 +307,7 @@ class MixpanelReactNativeSessionReplayModule(reactContext: ReactApplicationConte
|
|
|
287
307
|
|
|
288
308
|
companion object {
|
|
289
309
|
const val NAME = "MixpanelReactNativeSessionReplay"
|
|
290
|
-
const val LIB_VERSION = "0.
|
|
310
|
+
const val LIB_VERSION = "1.0.0"
|
|
291
311
|
const val MP_LIB = "react-native-sr"
|
|
292
312
|
}
|
|
293
313
|
}
|
|
@@ -74,7 +74,7 @@ RCT_EXPORT_METHOD(identify:(NSString *)distinctId
|
|
|
74
74
|
reject(@"INVALID_DISTINCT_ID", @"distinctId is required", nil);
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
[MixpanelSwiftSessionReplay identify:distinctId];
|
|
79
79
|
resolve(nil);
|
|
80
80
|
}
|
|
@@ -83,6 +83,31 @@ RCT_EXPORT_METHOD(identify:(NSString *)distinctId
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
RCT_EXPORT_METHOD(getReplayId:(RCTPromiseResolveBlock)resolve
|
|
87
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
88
|
+
{
|
|
89
|
+
@try {
|
|
90
|
+
NSString *replayId = [MixpanelSwiftSessionReplay getReplayId];
|
|
91
|
+
resolve(replayId);
|
|
92
|
+
}
|
|
93
|
+
@catch (NSException *exception) {
|
|
94
|
+
reject(@"GET_REPLAY_ID_ERROR", exception.reason, nil);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
RCT_EXPORT_METHOD(flush:(RCTPromiseResolveBlock)resolve
|
|
99
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
100
|
+
{
|
|
101
|
+
@try {
|
|
102
|
+
[MixpanelSwiftSessionReplay flushWithCompletionHandler:^{
|
|
103
|
+
resolve(nil);
|
|
104
|
+
}];
|
|
105
|
+
}
|
|
106
|
+
@catch (NSException *exception) {
|
|
107
|
+
reject(@"FLUSH_ERROR", exception.reason, nil);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
86
111
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
87
112
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
88
113
|
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
@@ -3,7 +3,7 @@ import MixpanelSessionReplay
|
|
|
3
3
|
import UIKit
|
|
4
4
|
|
|
5
5
|
@objc public class MixpanelSwiftSessionReplay: NSObject {
|
|
6
|
-
static let libVersion = "0.2.
|
|
6
|
+
static let libVersion = "0.2.1"
|
|
7
7
|
static let mpLib = "react-native-sr"
|
|
8
8
|
|
|
9
9
|
@objc public static func startRecording(recordingSessionsPercent: Double = 100.0) {
|
|
@@ -70,6 +70,18 @@ import UIKit
|
|
|
70
70
|
MPSessionReplay.getInstance()?.identify(distinctId: distinctId)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
@objc public static func getReplayId() -> String? {
|
|
74
|
+
return MPSessionReplay.getReplayId()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@objc public static func flush(completionHandler: @escaping () -> Void) {
|
|
78
|
+
guard let instance = MPSessionReplay.getInstance() else {
|
|
79
|
+
completionHandler()
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
instance.flush(completionHandler: completionHandler)
|
|
83
|
+
}
|
|
84
|
+
|
|
73
85
|
@objc public static func setMPReplaySensitive(value: Bool, view: UIView) {
|
|
74
86
|
view.mpReplaySensitive = value
|
|
75
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","TurboModuleRegistry","isTurboModuleEnabled","global","__turboModuleProxy","MixpanelReactNativeSessionReplay","get","e","console","warn","errorMessage","Error"],"sourceRoot":"../../src","sources":["NativeMixpanelReactNativeSessionReplay.ts"],"mappings":";;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,cAAc;;
|
|
1
|
+
{"version":3,"names":["NativeModules","TurboModuleRegistry","isTurboModuleEnabled","global","__turboModuleProxy","MixpanelReactNativeSessionReplay","get","e","console","warn","errorMessage","Error"],"sourceRoot":"../../src","sources":["NativeMixpanelReactNativeSessionReplay.ts"],"mappings":";;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,cAAc;;AAiBjE;;AAKA;AACA;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,IAAIC,gCAA6C,GAAG,IAAI;AAExD,IAAIH,oBAAoB,EAAE;EACxB;EACA,IAAI;IACFG,gCAAgC,GAAGJ,mBAAmB,CAACK,GAAG,CACxD,kCACF,CAAC;EACH,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV;IACAC,OAAO,CAACC,IAAI,CACV,4FACF,CAAC;EACH;AACF;;AAEA;AACA,IAAI,CAACJ,gCAAgC,EAAE;EACrCA,gCAAgC,GAC9BL,aAAa,CAACK,gCAAgC;AAClD;;AAEA;AACA,IAAI,CAACA,gCAAgC,EAAE;EACrC,MAAMK,YAAY,GAChB,+FAA+F,GAC/F,mJAAmJ,GACnJ,4DAA4D,GAC5D,2GAA2G,GAC3G,sFAAsF,GACtF,yEAAyE;EAE3E,MAAM,IAAIC,KAAK,CAACD,YAAY,CAAC;AAC/B;AAEA,eAAeL,gCAAgC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -184,12 +184,38 @@ async function identify(distinctId) {
|
|
|
184
184
|
}
|
|
185
185
|
return MixpanelReactNativeSessionReplay.identify(distinctId);
|
|
186
186
|
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Gets the current replay ID.
|
|
190
|
+
*
|
|
191
|
+
* Returns the unique identifier for the current replay session, or null if no replay is active.
|
|
192
|
+
* This ID can be used to correlate session replays with other analytics data.
|
|
193
|
+
*
|
|
194
|
+
* @returns A promise that resolves to the replay ID string or null if no replay is active.
|
|
195
|
+
*/
|
|
196
|
+
async function getReplayId() {
|
|
197
|
+
return MixpanelReactNativeSessionReplay.getReplayId();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Manually triggers a flush of pending session replay events.
|
|
202
|
+
*
|
|
203
|
+
* This method forces the SDK to immediately upload all pending Session Replay events to Mixpanel,
|
|
204
|
+
* bypassing the normal flush interval. The returned promise resolves when the flush operation completes.
|
|
205
|
+
*
|
|
206
|
+
* @returns A promise that resolves when the flush operation has completed.
|
|
207
|
+
*/
|
|
208
|
+
async function flush() {
|
|
209
|
+
return MixpanelReactNativeSessionReplay.flush();
|
|
210
|
+
}
|
|
187
211
|
export { MPSessionReplayView } from "./MixpanelSessionReplayView.js";
|
|
188
212
|
export const MPSessionReplay = {
|
|
189
213
|
initialize,
|
|
190
214
|
startRecording,
|
|
191
215
|
stopRecording,
|
|
192
216
|
isRecording,
|
|
193
|
-
identify
|
|
217
|
+
identify,
|
|
218
|
+
getReplayId,
|
|
219
|
+
flush
|
|
194
220
|
};
|
|
195
221
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","MixpanelReactNativeSessionReplay","MPSessionReplayMask","MPSessionReplayConfig","constructor","wifiOnly","autoStartRecording","recordingSessionsPercent","autoMaskedViews","Image","Text","Web","Map","flushInterval","enableLogging","transformMaskValueForPlatform","value","OS","charAt","toUpperCase","slice","toJSON","transformedAutoMaskedViews","filter","mask","map","config","JSON","stringify","initialize","token","distinctId","Error","undefined","json","startRecording","stopRecording","isRecording","identify","MPSessionReplayView","MPSessionReplay"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,gCAAgC,MAAM,6CAA0C;AAEvF,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAO/B,OAAO,MAAMC,qBAAqB,CAAC;EACjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAGEC,WAAWA,CAAC;IACVC,QAAQ,GAAG,IAAI;IACfC,kBAAkB,GAAG,IAAI;IACzBC,wBAAwB,GAAG,GAAG;IAC9BC,eAAe,GAAG,CAChBN,m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ACoC,WAAW,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,QAAQA,CAACP,UAAkB,EAAiB;EACzD,IAAI,CAACA,UAAU,IAAI,OAAOA,UAAU,KAAK,QAAQ,EAAE;IACjD,MAAM,IAAIC,KAAK,CAAC,6CAA6C,CAAC;EAChE;EAEA,OAAO/B,gCAAgC,CAACqC,QAAQ,CAACP,UAAU,CAAC;AAC9D;AAEA,
|
|
1
|
+
{"version":3,"names":["Platform","MixpanelReactNativeSessionReplay","MPSessionReplayMask","MPSessionReplayConfig","constructor","wifiOnly","autoStartRecording","recordingSessionsPercent","autoMaskedViews","Image","Text","Web","Map","flushInterval","enableLogging","transformMaskValueForPlatform","value","OS","charAt","toUpperCase","slice","toJSON","transformedAutoMaskedViews","filter","mask","map","config","JSON","stringify","initialize","token","distinctId","Error","undefined","json","startRecording","stopRecording","isRecording","identify","getReplayId","flush","MPSessionReplayView","MPSessionReplay"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,gCAAgC,MAAM,6CAA0C;AAEvF,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAO/B,OAAO,MAAMC,qBAAqB,CAAC;EACjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAGEC,WAAWA,CAAC;IACVC,QAAQ,GAAG,IAAI;IACfC,kBAAkB,GAAG,IAAI;IAC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eAAeC,WAAWA,CAAA,EAAqB;EAC7C,OAAOpC,gCAAgC,CAACoC,WAAW,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,QAAQA,CAACP,UAAkB,EAAiB;EACzD,IAAI,CAACA,UAAU,IAAI,OAAOA,UAAU,KAAK,QAAQ,EAAE;IACjD,MAAM,IAAIC,KAAK,CAAC,6CAA6C,CAAC;EAChE;EAEA,OAAO/B,gCAAgC,CAACqC,QAAQ,CAACP,UAAU,CAAC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeQ,WAAWA,CAAA,EAA2B;EACnD,OAAOtC,gCAAgC,CAACsC,WAAW,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,KAAKA,CAAA,EAAkB;EACpC,OAAOvC,gCAAgC,CAACuC,KAAK,CAAC,CAAC;AACjD;AAEA,SAASC,mBAAmB,QAAQ,gCAA6B;AAEjE,OAAO,MAAMC,eAAe,GAAG;EAC7Bb,UAAU;EACVM,cAAc;EACdC,aAAa;EACbC,WAAW;EACXC,QAAQ;EACRC,WAAW;EACXC;AACF,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,8 @@ export interface Spec extends TurboModule {
|
|
|
5
5
|
stopRecording(): Promise<void>;
|
|
6
6
|
isRecording(): Promise<boolean>;
|
|
7
7
|
identify(distinctId: string): Promise<void>;
|
|
8
|
+
getReplayId(): Promise<string | null>;
|
|
9
|
+
flush(): Promise<void>;
|
|
8
10
|
}
|
|
9
11
|
declare global {
|
|
10
12
|
var __turboModuleProxy: unknown | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeMixpanelReactNativeSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/NativeMixpanelReactNativeSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cA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113,6 +113,24 @@ declare function isRecording(): Promise<boolean>;
|
|
|
113
113
|
* @throws An error if the distinctId is missing or invalid.
|
|
114
114
|
*/
|
|
115
115
|
declare function identify(distinctId: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the current replay ID.
|
|
118
|
+
*
|
|
119
|
+
* Returns the unique identifier for the current replay session, or null if no replay is active.
|
|
120
|
+
* This ID can be used to correlate session replays with other analytics data.
|
|
121
|
+
*
|
|
122
|
+
* @returns A promise that resolves to the replay ID string or null if no replay is active.
|
|
123
|
+
*/
|
|
124
|
+
declare function getReplayId(): Promise<string | null>;
|
|
125
|
+
/**
|
|
126
|
+
* Manually triggers a flush of pending session replay events.
|
|
127
|
+
*
|
|
128
|
+
* This method forces the SDK to immediately upload all pending Session Replay events to Mixpanel,
|
|
129
|
+
* bypassing the normal flush interval. The returned promise resolves when the flush operation completes.
|
|
130
|
+
*
|
|
131
|
+
* @returns A promise that resolves when the flush operation has completed.
|
|
132
|
+
*/
|
|
133
|
+
declare function flush(): Promise<void>;
|
|
116
134
|
export { MPSessionReplayView } from './MixpanelSessionReplayView';
|
|
117
135
|
export declare const MPSessionReplay: {
|
|
118
136
|
initialize: typeof initialize;
|
|
@@ -120,5 +138,7 @@ export declare const MPSessionReplay: {
|
|
|
120
138
|
stopRecording: typeof stopRecording;
|
|
121
139
|
isRecording: typeof isRecording;
|
|
122
140
|
identify: typeof identify;
|
|
141
|
+
getReplayId: typeof getReplayId;
|
|
142
|
+
flush: typeof flush;
|
|
123
143
|
};
|
|
124
144
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAGA,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED,qBAAa,qBAAqB;IAChC;;;;;;;OAOG;IACH,QAAQ,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,CAAC"}
|
package/package.json
CHANGED
|
@@ -12,6 +12,8 @@ export interface Spec extends TurboModule {
|
|
|
12
12
|
// Functionality not available in Android SDK ATM. It returns true always.
|
|
13
13
|
isRecording(): Promise<boolean>;
|
|
14
14
|
identify(distinctId: string): Promise<void>;
|
|
15
|
+
getReplayId(): Promise<string | null>;
|
|
16
|
+
flush(): Promise<void>;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
// Type declaration for global to include __turboModuleProxy
|
package/src/index.tsx
CHANGED
|
@@ -217,6 +217,30 @@ async function identify(distinctId: string): Promise<void> {
|
|
|
217
217
|
return MixpanelReactNativeSessionReplay.identify(distinctId);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Gets the current replay ID.
|
|
222
|
+
*
|
|
223
|
+
* Returns the unique identifier for the current replay session, or null if no replay is active.
|
|
224
|
+
* This ID can be used to correlate session replays with other analytics data.
|
|
225
|
+
*
|
|
226
|
+
* @returns A promise that resolves to the replay ID string or null if no replay is active.
|
|
227
|
+
*/
|
|
228
|
+
async function getReplayId(): Promise<string | null> {
|
|
229
|
+
return MixpanelReactNativeSessionReplay.getReplayId();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Manually triggers a flush of pending session replay events.
|
|
234
|
+
*
|
|
235
|
+
* This method forces the SDK to immediately upload all pending Session Replay events to Mixpanel,
|
|
236
|
+
* bypassing the normal flush interval. The returned promise resolves when the flush operation completes.
|
|
237
|
+
*
|
|
238
|
+
* @returns A promise that resolves when the flush operation has completed.
|
|
239
|
+
*/
|
|
240
|
+
async function flush(): Promise<void> {
|
|
241
|
+
return MixpanelReactNativeSessionReplay.flush();
|
|
242
|
+
}
|
|
243
|
+
|
|
220
244
|
export { MPSessionReplayView } from './MixpanelSessionReplayView';
|
|
221
245
|
|
|
222
246
|
export const MPSessionReplay = {
|
|
@@ -225,4 +249,6 @@ export const MPSessionReplay = {
|
|
|
225
249
|
stopRecording,
|
|
226
250
|
isRecording,
|
|
227
251
|
identify,
|
|
252
|
+
getReplayId,
|
|
253
|
+
flush,
|
|
228
254
|
};
|