@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/cjs/index.js CHANGED
@@ -6826,6 +6826,17 @@ function addGlobalListeners(replay) {
6826
6826
  client.on('finishTransaction', transaction => {
6827
6827
  replay.lastTransaction = transaction;
6828
6828
  });
6829
+
6830
+ // We want to flush replay
6831
+ client.on('beforeSendFeedback', (feedbackEvent, options) => {
6832
+ const replayId = replay.getSessionId();
6833
+ if (options && options.includeReplay && replay.isEnabled() && replayId) {
6834
+ void replay.flush();
6835
+ if (feedbackEvent.contexts && feedbackEvent.contexts.feedback) {
6836
+ feedbackEvent.contexts.feedback.replay_id = replayId;
6837
+ }
6838
+ }
6839
+ });
6829
6840
  }
6830
6841
  }
6831
6842