Error monitoring for Next.js apps
One script tag in your root layout, and every client-side error arrives explained.The fast way: ask your AI tool
Works with both the App Router and the Pages Router.It will work out where the snippet goes, put it there, and check that it worked. If it gets stuck, the instructions tell it how to recover.Paste this into your chatInstall Vigil error monitoring in this app. Follow the instructions at https://vigill.dev/skill?key=vg_pub_YOUR_KEY exactly, then confirm installation succeeded.
The manual way
Paste this in the <head> of app/layout.tsx (App Router), or pages/_document.tsx (Pages Router) — usuallyapp/layout.tsx, then redeploy.This key is meant to be public — it can only send errors in, never read anything out. Do not move it into an environment variable; static hosts have nothing to read one back at runtime.app/layout.tsx — html<script src="https://vigill.dev/v.js" data-vigil-key="vg_pub_YOUR_KEY"></script>
When a React component throws while rendering, React removes the whole page and the browser never reports it. Wrapping your app catches those, and shows your users a message instead of a white screen.
App.tsx — tsximport { VigilErrorBoundary } from '@vigil/react';export default function App() {return (<VigilErrorBoundary><YourApp /></VigilErrorBoundary>);}