These docs are for v1.0. Click to read the latest docs for v3.0.

TrackJS

Integrating LogRocket with TrackJS

Add a LogRocket session recording URL to every TrackJS exception report.

window._trackJs = {
  token: "TOKEN",

  // other stuff
  onError: function (payload, error){
    payload.metadata.push({
      key: "LogRocket URL",
      value: (LogRocket || {}).sessionURL
    });

    return true; // Ensure error gets sent
  }
}