Highlight ships @highlight-run/next which can be installed alongside highlight.run and @highlight-run/react for capturing backend errors and stack traces in Next.js applications.
Under the hood this SDK relies on our Node SDK, which makes all features available there also available here. The usage of this backend SDK requires our Next.js client SDK to be installed, so please follow the instructions if you have not done so.
First, import the package
Define the Highlight backend package with intended options in a common function file
Wrap each of your route handlers in the NextJS /api/ directory with the withHighlight function we defined in the configuration step.
To view and resolve the recorded error, log into app.highlight.run 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.