@appsignal/plugin-window-events plugin binds to the window.onerror and window.onunhandledrejection event handlers to catch any errors that are otherwise not caught elsewhere in your code.
Installation
Add the@appsignal/plugin-window-events and @appsignal/javascript packages to your package.json file and run yarn install/npm install.
You can also add these packages to your package.json on the command line:
Usage
Use with Next.js
Even with"use client", Next.js pre-renders client components on the server, where the window object is not available. Guard the plugin initialization with:
plugin options
The plugin can be initialized with the following options: