---
updatedAt: 2025-01-30T22:58:49.000Z
agentTools:
  projectIndex: https://docs.logrocket.com/llms.txt
---

# Backend Error Reproduction

Tracing backend errors to the user sessions that caused them.

When backend requests cause exceptions or fail, it's often helpful to see how the user arrived at the buggy application state.

<Image width="100%" src="https://files.readme.io/d3ddf2d-Image_2017-05-24_at_2.08.05_PM.png" />

Integrating LogRocket with backend logging tools lets you see the corresponding LogRocket session for every backend network log. The simplest way to do this is to add an extra header to network requests like this:

```javascript
var recordingURL;
LogRocket.getSessionURL(function(sessionURL) {
  recordingURL = sessionURL;
});

fetch(API, {
  headers: { 
    // other headers
    'X-LogRocket-URL': recordingURL,
  },
});
```

Then, when you view logs or backend errors, you can inspect the headers to get a link directly to the LogRocket session to see what on the frontend triggered the backend issue:

![1458](https://files.readme.io/9a04c12-Image_2017-05-24_at_1.59.55_PM.public.png "Image 2017-05-24 at 1.59.55 PM.public.png")

Read more about the [data that LogRocket collects](https://docs.logrocket.com/docs/data-collected) to help you reproduce backend bugs.