Rollbar

Unlock advanced error insights in Rollbar with Zipy session URLs for contextual debugging and efficient issue resolution.

Add a Zipy session URL to every Rollbar exception report.

const getCurrentZipySessionURL = async () => {
  return await new Promise(function(resolve, reject) {
      let i = 0;
      const _interval = setInterval(() => {
          let zipySessionUrl = (window)?.zipy?.getCurrentSessionURL();
          
          if(zipySessionUrl){
              resolve(zipySessionUrl);
              clearInterval(_interval);
          }
          else{
              i++;
              if(i >= 4){
                reject("Some problem occured while loading zipy.");
                clearInterval(_interval);
              }
          }
      },1500);
  });
}

getCurrentZipySessionURL()
.then(zipySessionUrl => {
    Rollbar.configure({
        transform: function (obj) {
            obj.zipySessionUrl = zipySessionUrl;
        },
    });
})
.catch((e) => {
    console.log(e);
});

This code waits for zipy to get initialized and then adds zipy session url in Rollbar configuration so that when a error occurs zipy session url gets attached with error data and can be seen in rollbar error context as the value of zipySessionURL .

Zipy session url inside rollbar can be useful for associating errors with specific user sessions or other contextual information that is not captured by default. By adding a custom property like zipySessionURL to the error payload, you can make it easier to track down and diagnose errors that are specific to certain user sessions or contexts.

Last updated