index.ts1085 chars36 linesIn the example above, we install the necessary dependencies, import Logsnag and create a new instance, import the withErrorLogging higher order function for Next.js pages, and define a new page using the withErrorLogging function.
We also create a custom _app.tsx file and wrap it in the LogsnagErrorBoundary component provided by Logsnag to capture errors that may occur throughout the application.
With these implementations, any errors that occur within the app will be captured by Logsnag and sent to the specified project.
gistlibby LogSnag