Seeing What Your Users See
When your app runs for thousands of people, someone's session will always break. Error monitoring services give you instant visibility into real user problems.
How It Works
A small library intercepts all errors (via window.onerror and unhandledrejection) and sends them to a monitoring server with rich context:
- Error message and full stack trace
- User's browser, OS, and device model
- A session replay — the exact sequence of actions the user took before the error
// Sentry setup (one-time, in your app entry point)
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: 'https://your-key@sentry.io/project-id',
tracesSampleRate: 0.1 // Sample 10% of transactions for performance
});
// Sentry now captures all unhandled errors automatically!
// Capture a specific error manually:
try {
riskyOperation();
} catch (err) {
Sentry.captureException(err);
showUserError('Something went wrong. We have been notified.');
}
Tip
Sentry is the industry standard. It automatically groups identical errors and can notify you via Slack or email when error rates spike.
Important
Error monitoring is not " surveillance " — it's quality care for your product. Without it, you are completely blind to the problems your users actually experience.