Amplitude-TypeScript
Amplitude-TypeScript copied to clipboard
@amplitude/plugin-session-replay-browser v 1.11.3 does not call shutdown()
Expected Behavior
Calling sessionReplay.shutdown() should stop recording
Current Behavior
When running in debug mode, calling shutdown() logged the shutdown action in v1.9.4 (my previous version) and stopped the recording. In v1.11.3, nothing gets logged and the recording continues. I am using the segment wrapper.
Using the latest wrapper and session-replay-browser breaks shutdown functionality, reverting to wrapper version 0.1.0 and session-replay-browser v1.9.4 works.
Possible Solution
Steps to Reproduce
- install @amplitude/plugin-session-replay-browser v1.11.3, and @amplitude/segment-session-replay-wrapper v0.3.1 (both latest)
- Im using @segment/analytics-next v1.72.1 (latest)
const segment = new AnalyticsBrowser()
// 3. call action to load segment
const initSegment = () => segment.load({ writeKey: API_KEY })
// 4. call action to initialize SR wrapper, pass instance, API key etc
const initSRWrapper = () => setupAmpSRSegmentWrapper({ segmentInstance: segment, ... })
// 5. call action to shut down recording
const shutdownSR = () => sessionReplay.shutdown()
## Environment
- JS SDK Version: versions listed above
- Installation Method: Yarn
- Browser and Version: Chrome 126