Skip to content

Commit

Permalink
feat: add $recording_status property (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Nov 29, 2024
1 parent 60c4178 commit 7cb2e80
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/__tests__/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ describe('posthog core', () => {
$session_id: 'sessionId',
$is_identified: false,
$process_person_profile: false,
$recording_status: 'buffering',
})
})

Expand All @@ -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',
})
})

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
4 changes: 4 additions & 0 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7cb2e80

Please sign in to comment.