Guides
Add veriq to a Next.js project in 5 minutes
Full walkthrough: install, configure, verify, upload source maps. Works with the App Router and Pages Router.
Prerequisites
- Next.js 13+ (App Router or Pages Router)
- A veriq account and project — Project Settings → API Keys has your DSN
1. Install the SDK
2. Add VeriqClient
VeriqClient is a client component that initialises error tracking, Web Vitals collection, and console breadcrumbs. Place it inside <body> in your root layout so it loads on every page.
3. Configure env vars
Copy your DSN from Project Settings → API Keys (it starts with pk_).
The DSN is a public key — safe to expose in client-side code. Errors are authenticated server-side using a hashed key.
4. Capture errors manually
Unhandled errors are captured automatically. For handled errors and custom messages:
5. Upload source maps (recommended)
Source maps let veriq show your original TypeScript code in stack traces instead of minified output. Install the CLI and add an upload step to your build:
The secret key (sk_...) is separate from the DSN — keep it in CI environment variables, never in client code.
What's captured automatically
- Unhandled JavaScript errors (via
window.onerror) - Unhandled promise rejections
- Web Vitals — LCP, FID, CLS, FCP, TTFB
console.errorandconsole.warnas breadcrumbs- Route changes as navigation breadcrumbs
- User context (if you call
setUser())