diff --git a/src/__tests__/extensions/replay/sessionrecording.test.ts b/src/__tests__/extensions/replay/sessionrecording.test.ts index a0c676588..232022864 100644 --- a/src/__tests__/extensions/replay/sessionrecording.test.ts +++ b/src/__tests__/extensions/replay/sessionrecording.test.ts @@ -52,7 +52,7 @@ import { SimpleEventEmitter } from '../../../utils/simple-event-emitter' // Type and source defined here designate a non-user-generated recording event -jest.mock('../../../config', () => ({ LIB_VERSION: 'v0.0.1' })) +jest.mock('../../../config', () => ({ LIB_VERSION: '0.0.1' })) const EMPTY_BUFFER = { data: [], @@ -858,6 +858,8 @@ describe('SessionRecording', () => { ], $session_id: sessionId, $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, { _url: 'https://test.com/s/', @@ -893,6 +895,8 @@ describe('SessionRecording', () => { { type: 3, data: { source: 1 } }, { type: 3, data: { source: 2 } }, ], + $lib: 'web', + $lib_version: '0.0.1', }, { _url: 'https://test.com/s/', @@ -973,6 +977,8 @@ describe('SessionRecording', () => { $window_id: 'windowId', $snapshot_data: [{ data: { source: 1 }, emit: 1, type: 3 }], $snapshot_bytes: 39, + $lib: 'web', + $lib_version: '0.0.1', }, { _url: 'https://test.com/s/', @@ -1580,6 +1586,8 @@ describe('SessionRecording', () => { $session_id: firstSessionId, $snapshot_bytes: 186, $window_id: expect.any(String), + $lib: 'web', + $lib_version: '0.0.1', }, { _batchKey: 'recordings', @@ -1670,6 +1678,8 @@ describe('SessionRecording', () => { $session_id: firstSessionId, $snapshot_bytes: 186, $window_id: expect.any(String), + $lib: 'web', + $lib_version: '0.0.1', }, { _batchKey: 'recordings', @@ -1696,6 +1706,8 @@ describe('SessionRecording', () => { $session_id: firstSessionId, $snapshot_bytes: 186, $window_id: expect.any(String), + $lib: 'web', + $lib_version: '0.0.1', }, { _batchKey: 'recordings', @@ -2116,6 +2128,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2137,6 +2151,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2166,6 +2182,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2196,6 +2214,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2215,6 +2235,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: 86, $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2239,6 +2261,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: 58, $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2262,6 +2286,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: 69, $window_id: 'windowId', + $lib: 'web', + $lib_version: '0.0.1', }, captureOptions ) @@ -2308,6 +2334,8 @@ describe('SessionRecording', () => { { type: 3, data: { source: 1 } }, { type: 3, data: { source: 2 } }, ], + $lib: 'web', + $lib_version: '0.0.1', }, expect.any(Object) ) diff --git a/src/extensions/replay/sessionrecording.ts b/src/extensions/replay/sessionrecording.ts index 030501aab..36d95dad7 100644 --- a/src/extensions/replay/sessionrecording.ts +++ b/src/extensions/replay/sessionrecording.ts @@ -46,6 +46,7 @@ import { MutationRateLimiter } from './mutation-rate-limiter' import { gzipSync, strFromU8, strToU8 } from 'fflate' import { clampToRange } from '../../utils/number-utils' import { includes } from '../../utils' +import Config from '../../config' const LOGGER_PREFIX = '[SessionRecording]' const logger = createLogger(LOGGER_PREFIX) @@ -1185,6 +1186,8 @@ export class SessionRecording { $snapshot_data: snapshotBuffer.data, $session_id: snapshotBuffer.sessionId, $window_id: snapshotBuffer.windowId, + $lib: 'web', + $lib_version: Config.LIB_VERSION, }) }) }