@multiplayer-app/session-recorder-react-native 0.0.1-beta.7 → 0.0.1-beta.8

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 (74) hide show
  1. package/docs/NATIVE_MODULE_SETUP.md +175 -0
  2. package/ios/SessionRecorderNative.podspec +5 -0
  3. package/package.json +11 -1
  4. package/plugin/package.json +20 -0
  5. package/plugin/src/index.js +42 -0
  6. package/android/src/main/AndroidManifest.xml +0 -2
  7. package/android/src/main/java/com/multiplayer/sessionrecorder/ScreenMaskingModule.kt +0 -202
  8. package/android/src/main/java/com/multiplayer/sessionrecorder/ScreenMaskingPackage.kt +0 -16
  9. package/android/src/main/java/com/multiplayer/sessionrecorder/SessionRecorderModule.kt +0 -202
  10. package/android/src/main/java/com/multiplayer/sessionrecorder/SessionRecorderPackage.kt +0 -16
  11. package/babel.config.js +0 -13
  12. package/docs/AUTO_METADATA_DETECTION.md +0 -108
  13. package/docs/TROUBLESHOOTING.md +0 -168
  14. package/ios/ScreenMasking.m +0 -12
  15. package/ios/ScreenMasking.podspec +0 -21
  16. package/ios/ScreenMasking.swift +0 -205
  17. package/ios/SessionRecorder.podspec +0 -21
  18. package/scripts/generate-app-metadata.js +0 -173
  19. package/src/components/GestureCaptureWrapper/GestureCaptureWrapper.tsx +0 -86
  20. package/src/components/GestureCaptureWrapper/index.ts +0 -1
  21. package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +0 -72
  22. package/src/components/ScreenRecorderView/index.ts +0 -1
  23. package/src/components/SessionRecorderWidget/FinalPopover.tsx +0 -62
  24. package/src/components/SessionRecorderWidget/FloatingButton.tsx +0 -136
  25. package/src/components/SessionRecorderWidget/InitialPopover.tsx +0 -89
  26. package/src/components/SessionRecorderWidget/ModalContainer.tsx +0 -128
  27. package/src/components/SessionRecorderWidget/ModalHeader.tsx +0 -24
  28. package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +0 -109
  29. package/src/components/SessionRecorderWidget/icons.tsx +0 -52
  30. package/src/components/SessionRecorderWidget/index.ts +0 -3
  31. package/src/components/SessionRecorderWidget/styles.ts +0 -150
  32. package/src/components/index.ts +0 -3
  33. package/src/config/constants.ts +0 -60
  34. package/src/config/defaults.ts +0 -83
  35. package/src/config/index.ts +0 -6
  36. package/src/config/masking.ts +0 -28
  37. package/src/config/session-recorder.ts +0 -55
  38. package/src/config/validators.ts +0 -31
  39. package/src/context/SessionRecorderContext.tsx +0 -53
  40. package/src/index.ts +0 -9
  41. package/src/native/ScreenMasking.ts +0 -34
  42. package/src/native/SessionRecorderNative.ts +0 -34
  43. package/src/otel/helpers.ts +0 -275
  44. package/src/otel/index.ts +0 -138
  45. package/src/otel/instrumentations/index.ts +0 -115
  46. package/src/patch/index.ts +0 -1
  47. package/src/patch/xhr.ts +0 -141
  48. package/src/recorder/eventExporter.ts +0 -141
  49. package/src/recorder/gestureRecorder.ts +0 -498
  50. package/src/recorder/index.ts +0 -179
  51. package/src/recorder/navigationTracker.ts +0 -449
  52. package/src/recorder/screenRecorder.ts +0 -527
  53. package/src/services/api.service.ts +0 -203
  54. package/src/services/screenMaskingService.ts +0 -118
  55. package/src/services/storage.service.ts +0 -199
  56. package/src/session-recorder.ts +0 -606
  57. package/src/types/expo.d.ts +0 -23
  58. package/src/types/index.ts +0 -28
  59. package/src/types/session-recorder.ts +0 -429
  60. package/src/types/session.ts +0 -65
  61. package/src/utils/app-metadata.ts +0 -31
  62. package/src/utils/index.ts +0 -8
  63. package/src/utils/logger.ts +0 -225
  64. package/src/utils/nativeModuleTest.ts +0 -60
  65. package/src/utils/platform.ts +0 -384
  66. package/src/utils/request-utils.ts +0 -61
  67. package/src/utils/rrweb-events.ts +0 -309
  68. package/src/utils/session.ts +0 -18
  69. package/src/utils/time.ts +0 -17
  70. package/src/utils/type-utils.ts +0 -75
  71. package/src/version.ts +0 -1
  72. package/tsconfig.json +0 -24
  73. /package/ios/{SessionRecorder.m → SessionRecorderNative.m} +0 -0
  74. /package/ios/{SessionRecorder.swift → SessionRecorderNative.swift} +0 -0
@@ -1,429 +0,0 @@
1
-
2
- import { SessionType } from '@multiplayer-app/session-recorder-common'
3
- import { PropagateTraceHeaderCorsUrls } from '@opentelemetry/sdk-trace-web'
4
- import { Span } from '@opentelemetry/api'
5
- import type { ISession } from './session'
6
-
7
- export enum WidgetButtonPlacement {
8
- topLeft = 'top-left',
9
- topRight = 'top-right',
10
- bottomLeft = 'bottom-left',
11
- bottomRight = 'bottom-right',
12
- }
13
-
14
- export interface SessionRecorderOptions {
15
- /**
16
- * The API key used to authenticate with the session debugger service.
17
- */
18
- apiKey: string
19
-
20
- /**
21
- * The version of the application using the session debugger.
22
- */
23
- version: string
24
-
25
- /**
26
- * The name of the application being debugged.
27
- */
28
- application: string
29
-
30
- /**
31
- * The environment where the application is running (e.g., 'production', 'staging').
32
- */
33
- environment: string
34
-
35
- /**
36
- * (Optional) OTLP collector endpoint.
37
- */
38
- exporterEndpoint?: string
39
-
40
- /**
41
- * (Optional) Base URL for the API calls.
42
- * This allows customization of the API endpoint for sending session data.
43
- */
44
- apiBaseUrl?: string
45
-
46
- /**
47
- * (Optional) An array of URLs or regular expressions that should be ignored by the session debugger.
48
- * Any URL that partially matches any regex in this array will not be traced.
49
- * Additionally, URLs that exactly match any string in the array will also be ignored.
50
- */
51
- ignoreUrls?: Array<string | RegExp>
52
-
53
- /**
54
- * (Optional) Determines where the record button should be placed on the screen.
55
- * Possible values:
56
- * - 'top-left'
57
- * - 'top-right'
58
- * - 'bottom-left'
59
- * - 'bottom-right'
60
- */
61
- widgetButtonPlacement?: WidgetButtonPlacement
62
-
63
- /**
64
- * (Optional) Enables the continuous recording feature and UI.
65
- * If false, the UI toggle is hidden and attempts to start a continuous
66
- * session are ignored.
67
- * @default true
68
- */
69
- showContinuousRecording?: boolean
70
-
71
- /**
72
- * (Optional) If false, the session recording widget will be hidden from the UI.
73
- * Use this option if you want to enable session recording without a visible UI element.
74
- * @default showWidget = true
75
- */
76
- showWidget?: boolean
77
-
78
-
79
- /**
80
- * (Optional) Trace ID Ratio for sampling
81
- * @default 0.15
82
- */
83
- sampleTraceRatio?: number
84
-
85
- /**
86
- * (Optional) URLs or regex patterns for CORS trace header propagation
87
- */
88
- propagateTraceHeaderCorsUrls?: PropagateTraceHeaderCorsUrls
89
-
90
- /**
91
- * (Optional) If true, schematizes document span payload
92
- * @default true
93
- */
94
- schemifyDocSpanPayload?: boolean
95
-
96
- /**
97
- * (Optional) Maximum size for capturing HTTP payload
98
- * @default 100000
99
- */
100
- maxCapturingHttpPayloadSize?: number
101
-
102
- /**
103
- * (Optional) If true, uses post message fallback
104
- * @default false
105
- */
106
- usePostMessageFallback?: boolean
107
-
108
-
109
- /** If true, captures body in traces
110
- * @default true
111
- */
112
- captureBody?: boolean
113
- /** If true, captures headers in traces
114
- * @default true
115
- */
116
- captureHeaders?: boolean
117
-
118
- /**
119
- * (Optional) Configuration for masking sensitive data in session recordings
120
- * @default { maskAllInputs: true, isContentMaskingEnabled: true }
121
- */
122
- masking?: MaskingConfig
123
-
124
- /**
125
- * (Optional) Configuration for customizable UI text and labels
126
- * @default See PopoverTextConfig defaults
127
- */
128
- widgetTextOverrides?: WidgetTextOverridesConfig
129
-
130
-
131
- /** Whether to record gestures */
132
- recordGestures?: boolean
133
- /** Whether to record navigation */
134
- recordNavigation?: boolean
135
- /** Whether to record screen */
136
- recordScreen?: boolean
137
- }
138
-
139
- /**
140
- * Interface for masking configuration
141
- */
142
- export interface MaskingConfig {
143
- // Span masking
144
- /** If true, enables masking for debug span payload in traces
145
- * @default true
146
- */
147
- isContentMaskingEnabled?: boolean;
148
- /** Custom function for masking body in traces */
149
- maskBody?: (payload: any, span: Span) => any;
150
- /** Custom function for masking headers in traces */
151
- maskHeaders?: (headers: any, span: any) => any;
152
-
153
- /** List of body fields to mask in traces */
154
- maskBodyFieldsList?: string[]
155
- /** List of headers to mask in traces */
156
- maskHeadersList?: string[]
157
-
158
- /** List of headers to include in traces (if specified, only these headers will be captured) */
159
- headersToInclude?: string[]
160
- /** List of headers to exclude from traces */
161
- headersToExclude?: string[]
162
-
163
- /** Whether to mask all input fields during screen recording
164
- * @default true
165
- */
166
- inputMasking?: boolean
167
- }
168
-
169
- /**
170
- * Base configuration interface with common properties
171
- */
172
- export interface BaseConfig {
173
- /** API key for authentication */
174
- apiKey: string
175
- /** Base URL for the API calls */
176
- apiBaseUrl: string
177
- /** Base URL for the API calls */
178
- exporterEndpoint: string
179
- /** Whether to use post message fallback */
180
- usePostMessageFallback?: boolean
181
- }
182
-
183
- /**
184
- * Configuration interface for the Tracer class
185
- */
186
- export type TracerReactNativeMasking = Pick<MaskingConfig, 'isContentMaskingEnabled' | 'maskBody' | 'maskHeaders' | 'maskBodyFieldsList' | 'maskHeadersList' | 'headersToInclude' | 'headersToExclude'>;
187
-
188
- export interface TracerReactNativeConfig extends BaseConfig {
189
- /** Application name */
190
- application: string
191
- /** Application version */
192
- version: string
193
- /** Environment (e.g., 'production', 'staging') */
194
- environment: string
195
- /** URLs to ignore during tracing */
196
- ignoreUrls: Array<string | RegExp>
197
- /** Trace ID ratio for sampling */
198
- sampleTraceRatio: number
199
- /** URLs for CORS trace header propagation */
200
- propagateTraceHeaderCorsUrls: PropagateTraceHeaderCorsUrls
201
- /** Whether to schematize document span payload */
202
- schemifyDocSpanPayload: boolean
203
- /** Maximum size for capturing HTTP payload */
204
- maxCapturingHttpPayloadSize: number
205
- /** If true, captures body in traces
206
- * @default true
207
- */
208
- captureBody: boolean
209
- /** If true, captures headers in traces
210
- * @default true
211
- */
212
- captureHeaders: boolean
213
- /** Configuration for masking sensitive data in session recordings */
214
- masking: TracerReactNativeMasking
215
- }
216
-
217
- /**
218
- * Configuration interface for the Recorder class
219
- */
220
- // export type RecorderMasking = Pick<MaskingConfig, 'maskAllInputs' | 'maskTextClass' | 'maskTextSelector' | 'maskInputOptions' | 'maskInput' | 'maskText' | 'maskConsoleEvent'>;
221
-
222
- export interface RecorderConfig extends BaseConfig {
223
- /** Whether to record gestures */
224
- recordGestures?: boolean
225
- /** Whether to record navigation */
226
- recordNavigation?: boolean
227
- /** Whether to record screen */
228
- recordScreen?: boolean
229
- /** Configuration for masking sensitive data in session recordings */
230
- masking?: MaskingConfig
231
- }
232
-
233
- /**
234
- * Configuration interface for the SessionWidget class
235
- */
236
- export interface SessionWidgetConfig {
237
- /** Whether to show the widget */
238
- showWidget: boolean
239
- /** Placement of the widget button */
240
- widgetButtonPlacement: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
241
- /** Whether continuous recording feature is enabled */
242
- showContinuousRecording: boolean
243
- /** Configuration for customizable UI text and labels */
244
- widgetTextOverrides: WidgetTextOverridesConfig
245
- }
246
-
247
- /**
248
- * Interface for customizable widget text configuration
249
- */
250
- export interface WidgetTextOverridesConfig {
251
- /** Title for the initial popover when continuous recording is enabled */
252
- initialTitleWithContinuous?: string
253
- /** Title for the initial popover when continuous recording is disabled */
254
- initialTitleWithoutContinuous?: string
255
- /** Description for the initial popover when continuous recording is enabled */
256
- initialDescriptionWithContinuous?: string
257
- /** Description for the initial popover when continuous recording is disabled */
258
- initialDescriptionWithoutContinuous?: string
259
- /** Label for the continuous recording toggle */
260
- continuousRecordingLabel?: string
261
- /** Text for the start recording button */
262
- startRecordingButtonText?: string
263
- /** Title for the final popover */
264
- finalTitle?: string
265
- /** Description for the final popover */
266
- finalDescription?: string
267
- /** Placeholder text for the comment textarea */
268
- commentPlaceholder?: string
269
- /** Text for the save button in final popover */
270
- saveButtonText?: string
271
- /** Text for the cancel button in final popover */
272
- cancelButtonText?: string
273
- /** Title for the continuous recording overlay */
274
- continuousOverlayTitle?: string
275
- /** Description for the continuous recording overlay */
276
- continuousOverlayDescription?: string
277
- /** Text for the save last snapshot button */
278
- saveLastSnapshotButtonText?: string
279
- /** Title for the submit session dialog */
280
- submitDialogTitle?: string
281
- /** Subtitle for the submit session dialog */
282
- submitDialogSubtitle?: string
283
- /** Label for the comment field in submit dialog */
284
- submitDialogCommentLabel?: string
285
- /** Placeholder for the comment field in submit dialog */
286
- submitDialogCommentPlaceholder?: string
287
- /** Text for the submit button in dialog */
288
- submitDialogSubmitText?: string
289
- /** Text for the cancel button in dialog */
290
- submitDialogCancelText?: string
291
- }
292
-
293
- /**
294
- * Configuration interface for the ApiService class
295
- */
296
- export interface ApiServiceConfig extends BaseConfig { }
297
-
298
- export interface SessionRecorderConfigs extends Required<SessionRecorderOptions> { }
299
-
300
- export enum SessionState {
301
- started = '2',
302
- paused = '1',
303
- stopped = '0',
304
- }
305
-
306
- export interface ISessionRecorder {
307
- /**
308
- * The current session ID
309
- */
310
- readonly sessionId: string | null
311
-
312
- /**
313
- * Whether continuous recording is enabled
314
- */
315
- readonly continuousRecording: boolean
316
-
317
- /**
318
- * The current debug session object
319
- */
320
- readonly session: ISession | null
321
-
322
- /**
323
- * The type of session (plain or continuous)
324
- */
325
- readonly sessionType: SessionType
326
-
327
- /**
328
- * The current state of the session
329
- */
330
- readonly sessionState: SessionState | null
331
-
332
-
333
- /**
334
- * Session attributes for additional context
335
- */
336
- readonly sessionAttributes: Record<string, any>
337
-
338
- /**
339
- * Current error message
340
- */
341
- error: string
342
-
343
- /**
344
- * The HTML button element for the session widget's recorder button
345
- */
346
- readonly sessionWidgetButtonElement: HTMLButtonElement
347
-
348
- /**
349
- * Initialize the session debugger with custom configurations
350
- * @param configs - custom configurations for session debugger
351
- */
352
- init(configs: SessionRecorderOptions): void
353
-
354
- /**
355
- * Save the continuous recording session
356
- * @returns Promise that resolves to the save response
357
- */
358
- save(): Promise<any>
359
-
360
- /**
361
- * Start a new session
362
- * @param type - the type of session to start
363
- * @param session - optional existing session to start
364
- */
365
- start(type?: SessionType, session?: ISession): void
366
-
367
- /**
368
- * Stop the current session with an optional comment
369
- * @param comment - user-provided comment to include in session feedback metadata
370
- */
371
- stop(comment?: string): Promise<void>
372
-
373
- /**
374
- * Cancel the current session
375
- */
376
- cancel(): Promise<void>
377
-
378
- /**
379
- * Pause the current session
380
- */
381
- pause(): Promise<void>
382
-
383
- /**
384
- * Resume the current session
385
- */
386
- resume(): Promise<void>
387
-
388
- /**
389
- * Set the session metadata
390
- * @param attributes - the attributes to set
391
- */
392
- setSessionAttributes(attributes: Record<string, any>): void
393
-
394
- /**
395
- * Set a custom click handler for the recording button
396
- * @param handler - function that will be invoked when the button is clicked
397
- */
398
- set recordingButtonClickHandler(handler: () => boolean | void)
399
- }
400
-
401
- export type Breaker = {}
402
-
403
- export interface ScreenEvent {
404
- screenName: string
405
- timestamp: number
406
- params?: Record<string, any>
407
- type?: string
408
- metadata?: Record<string, any>
409
- dataUrl?: string
410
- }
411
-
412
- export interface GestureEvent {
413
- type: string
414
- timestamp: number
415
- x?: number
416
- y?: number
417
- direction?: string
418
- target?: string
419
- coordinates?: { x: number; y: number }
420
- metadata?: Record<string, any>
421
- }
422
-
423
- export interface NavigationEvent {
424
- type: string
425
- timestamp: number
426
- routeName?: string
427
- params?: Record<string, any>
428
- metadata?: Record<string, any>
429
- }
@@ -1,65 +0,0 @@
1
- import { SessionType } from '@multiplayer-app/session-recorder-common'
2
-
3
- export interface IResourceAttributes {
4
- browserInfo?: string,
5
- cookiesEnabled?: string,
6
- deviceInfo?: string,
7
- hardwareConcurrency?: number,
8
- osInfo?: string,
9
- pixelRatio?: number,
10
- screenSize?: string,
11
- packageVersion?: string,
12
- [key: string]: any
13
- }
14
-
15
- export interface ISessionAttributes {
16
- userEmail?: string
17
- userId?: string,
18
- userName?: string,
19
- accountId?: string,
20
- accountName?: string,
21
- [key: string]: any
22
- }
23
-
24
- export interface ISessionView {
25
- _id: string
26
- name: string
27
- components?: string[]
28
- }
29
-
30
- export interface ISession {
31
- _id: string
32
- shortId: string
33
- workspace: string
34
- project: string
35
- continuousDebugSession?: string
36
- creationType: SessionType
37
- name: string
38
- startedAt: string | Date
39
- stoppedAt: string | Date
40
- durationInSeconds?: number
41
- createdAt: string | Date
42
- updatedAt: string | Date
43
- tags: any[]
44
-
45
- resourceAttributes?: IResourceAttributes
46
- sessionAttributes?: ISessionAttributes
47
- views: ISessionView[]
48
- starred: boolean
49
- starredItems: string[]
50
- s3Files: {
51
- _id?: string
52
- bucket: string
53
- key: string
54
- dataType: DebugSessionDataType
55
- url?: string
56
- }[]
57
- finishedS3Transfer?: boolean
58
- tempApiKey?: string
59
- }
60
-
61
- export enum DebugSessionDataType {
62
- OTLP_TRACES = 'OTLP_TRACES',
63
- OTLP_LOGS = 'OTLP_LOGS',
64
- RRWEB_EVENTS = 'RRWEB_EVENTS',
65
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * Auto-generated app metadata
3
- * This file is generated at build time to provide app metadata without developer intervention
4
- */
5
-
6
- // This file is automatically generated by the build process
7
- // It extracts metadata from app.json, app.config.js, or package.json
8
-
9
- export interface AppMetadata {
10
- name?: string
11
- version?: string
12
- bundleId?: string
13
- buildNumber?: string
14
- displayName?: string
15
- }
16
-
17
- // Auto-detected values from project configuration files
18
- export const APP_METADATA: AppMetadata = {
19
- name: "@multiplayer-app/session-recorder-react-native",
20
- version: "0.0.1",
21
- bundleId: undefined,
22
- buildNumber: undefined,
23
- displayName: undefined,
24
- }
25
-
26
- /**
27
- * Get auto-detected app metadata
28
- */
29
- export function getAutoDetectedAppMetadata(): AppMetadata {
30
- return { ...APP_METADATA }
31
- }
@@ -1,8 +0,0 @@
1
- // Export all utility functions
2
- export * from './platform'
3
- export * from './session'
4
- export * from './time'
5
- export * from './type-utils'
6
- export * from './request-utils'
7
- export * from './rrweb-events'
8
- export * from './logger'