@highlight-run/node which can be installed alongside highlight.run for capturing backend errors and reporting metrics in applications with Node.js backends. This SDK is compatible with many other backend frameworks built on top of Node.js.
This backend SDK requires one of our Client SDKs to be installed, so please follow the instructions there if you have not done so.
For server-side linking to Highlight sessions, your client-side call to
H.init should include the
tracingOrigins setting. See H.init() for more details.
Adding Highlight to your Backend
First, import the package
Initialize the Highlight backend
Somewhere in your app, typically during startup or when handling errors, initialize the Highlight backend with any necessary options. See H.init() for a full list of options.
When your app throws a backend error, you can log that error to Highlight by calling H.consumeError() using the
requestId parameters from the request's header. Your error handling code will depend on the backend framework you use, but will likely look something like this:
To view and resolve the recorded error, log into app.highlight.run/errors and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved. You can also view frontend sessions where the error was thrown, and see the individual request which caused the error.