JavaScript error tracking
JavaScript error tracking for real users' browsers
Most frontend errors happen on devices you'll never see. @errorlenshq/browser reports them with the clicks, requests and navigation that led there — and source maps turn minified traces back into your code.
Install with npm or a script tag
npm install @errorlenshq/browserimport * as ErrorLens from "@errorlenshq/browser";
ErrorLens.init({
dsn: "https://<key>@errorlens.io/<project-id>",
release: "[email protected]",
tracesSampleRate: 0.1,
});<script src="https://cdn.jsdelivr.net/npm/@errorlenshq/browser@1/dist/errorlens.min.js" crossorigin="anonymous"></script>
<script>ErrorLens.init({ dsn: "https://<key>@errorlens.io/<project-id>" });</script>What is captured
- Uncaught errors and unhandled promise rejections
- Breadcrumbs: clicks with a readable element path,
fetch/XHR calls, navigation and console output - Page-load and route-change transactions with network timing and web vitals (LCP, FCP, CLS)
- A
traceparentheader on same-origin requests, so frontend and backend share one trace - Noise dropped: browser-extension errors, cross-origin “Script error.” and ResizeObserver warnings
Readable stack traces with source maps
Upload your source maps for each release from CI and ErrorLens shows the original file, line and code instead of main.4f2a.js:1:120554. See releases and source maps.
Reliable delivery
Reports are sent with fetch keepalive and flushed when the tab is hidden, so an error right before the user navigates away still arrives. Requests are CORS “simple” requests: no preflight round trip.
Frequently asked questions
Is the DSN safe to put in frontend code?
Yes. The DSN's key can only send data to its project; it can't read anything.
Does it work with React, Vue, Angular and Svelte?
Yes, it works with any framework. See the React and Next.js guides for error boundaries and server-side setup.
Will ad blockers block it?
Self-hosting on your own domain avoids most blocklists. On the hosted service, allow errorlens.io in your Content-Security-Policy connect-src.
Keep reading
React error tracking, including what your error boundaries catch
Track React errors caught by error boundaries and uncaught render errors, with component stacks, breadcrumbs and source maps. Works with React 18 and 19.
Next.js error tracking on the server and in the browser
Track Next.js errors on the server and in the browser: route handlers, server components and client errors in one trace. Setup with instrumentation.ts.
Releases and source maps
Open-source APM that links slow requests to their errors and logs
Open-source application performance monitoring: p50/p95 latency, throughput, failure rate and distributed traces linked to errors and logs. Self-host free.
Start tracking errors in minutes
Free hosted plan with 5,000 errors a month, or self-host with no limits. No credit card.