-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathrecorder.ts
More file actions
22 lines (18 loc) · 1.23 KB
/
recorder.ts
File metadata and controls
22 lines (18 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This file is kept only for backwards compatibility.
// In almost every case, if you are manually importing a file you should use posthog-recorder instead.
import { record as rrwebRecord } from '@rrweb/record'
import { getRecordConsolePlugin } from '@rrweb/rrweb-plugin-console-record'
import { getRecordNetworkPlugin } from '../extensions/replay/external/network-plugin'
import { assignableWindow } from '../utils/globals'
assignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}
assignableWindow.__PosthogExtensions__.rrwebPlugins = { getRecordConsolePlugin, getRecordNetworkPlugin }
assignableWindow.__PosthogExtensions__.rrweb = { record: rrwebRecord, version: 'v2' }
// we used to put all of these items directly on window, and now we put it on __PosthogExtensions__
// but that means that old clients which lazily load this extension are looking in the wrong place
// yuck,
// so we also put them directly on the window
// when 1.161.1 is the oldest version seen in production we can remove this
assignableWindow.rrweb = { record: rrwebRecord, version: 'v2' }
assignableWindow.rrwebConsoleRecord = { getRecordConsolePlugin }
assignableWindow.getRecordNetworkPlugin = getRecordNetworkPlugin
export default rrwebRecord