diff --git a/src/__tests__/posthog-core.ts b/src/__tests__/posthog-core.ts index 7f37eec5d..b3f2c1c9c 100644 --- a/src/__tests__/posthog-core.ts +++ b/src/__tests__/posthog-core.ts @@ -437,6 +437,7 @@ describe('posthog core', () => { $session_id: 'sessionId', $is_identified: false, $process_person_profile: false, + $recording_status: 'buffering', }) }) @@ -459,6 +460,7 @@ describe('posthog core', () => { $lib_custom_api_host: 'https://custom.posthog.com', $is_identified: false, $process_person_profile: false, + $recording_status: 'buffering', }) }) diff --git a/src/extensions/replay/sessionrecording.ts b/src/extensions/replay/sessionrecording.ts index 4b62ac142..195579786 100644 --- a/src/extensions/replay/sessionrecording.ts +++ b/src/extensions/replay/sessionrecording.ts @@ -384,7 +384,7 @@ export class SessionRecording { * defaults to buffering mode until a decide response is received * once a decide response is received status can be disabled, active or sampled */ - private get status(): SessionRecordingStatus { + get status(): SessionRecordingStatus { if (!this.receivedDecide) { return 'buffering' } diff --git a/src/posthog-core.ts b/src/posthog-core.ts index 6269f8f7f..c7594073e 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -947,6 +947,10 @@ export class PostHog { properties['$window_id'] = windowId } + if (this.sessionRecording) { + properties['$recording_status'] = this.sessionRecording.status + } + if (this.requestRouter.region === RequestRouterRegion.CUSTOM) { properties['$lib_custom_api_host'] = this.config.api_host }