@sentry/replay 7.81.0 → 7.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.js CHANGED
@@ -6824,6 +6824,17 @@ function addGlobalListeners(replay) {
6824
6824
  client.on('finishTransaction', transaction => {
6825
6825
  replay.lastTransaction = transaction;
6826
6826
  });
6827
+
6828
+ // We want to flush replay
6829
+ client.on('beforeSendFeedback', (feedbackEvent, options) => {
6830
+ const replayId = replay.getSessionId();
6831
+ if (options && options.includeReplay && replay.isEnabled() && replayId) {
6832
+ void replay.flush();
6833
+ if (feedbackEvent.contexts && feedbackEvent.contexts.feedback) {
6834
+ feedbackEvent.contexts.feedback.replay_id = replayId;
6835
+ }
6836
+ }
6837
+ });
6827
6838
  }
6828
6839
  }
6829
6840