Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Sending Data to server of pageleave (RRWEB event)

I am trying to send rrweb event on pageleave. There are two options to send the data to server either using sendBeacon or fetch api calls. But sendBeacon doesn't work for more than 5sec on rrweb events and fetch is getting cancelled on pageleave, my current implementation goes like this

var params = new URLSearchParams({
  key : 'data',
  values : JSON.stringify(sessionPayload)
});
navigator.sendBeacon(`${this.apiHost}/session`, params);

How can i solve the problem of sending the data to server effectively.

document.addEventListener("visibilitychange", function() {
  if (document.visibilityState === 'hidden') {
    sendRecording(); //sends the recording to server
    sessionRecordingEvents = [] //empties the event array
  } else {
    startRecording(); //starts recording again
  }
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!