Catch every error in production with @codmir/overseer — one import, zero config.

Error Tracking

This guide walks you through setting up automatic error capture with @codmir/overseer. By the end, every unhandled error, promise rejection, and console error in your app will appear in your Codmir dashboard.

Install

npm install @codmir/overseer

Initialize

Call init() once at your application's entry point. This hooks into global error handlers and starts capturing automatically.

import { init } from '@codmir/overseer';

init({
  dsn: 'https://your-project.codmir.com/overseer',
  service: 'my-app',
  environment: 'production',
});

After this single call, Overseer captures:

  • Unhandled JavaScript errors (window.onerror)
  • Unhandled promise rejections (unhandledrejection)
  • Console errors (optional)
  • Network errors (optional)

No additional code required.

Manual Capture

For errors you catch yourself, use captureException and captureMessage.

captureException

Wrap try/catch blocks to report caught errors with full context:

import { captureException } from '@codmir/overseer';

async function processPayment(orderId: string) {
  try {
    const result = await chargeCard(orderId);
    return result;
  } catch (error) {
    captureException(error, {
      level: 'error',
      tags: { feature: 'payments', orderId },
      extra: { cardLast4: '4242' },
    });
    throw error;
  }
}

captureMessage

Log important events that are not exceptions:

import { captureMessage } from '@codmir/overseer';

captureMessage('Rate limit approaching threshold', 'warning');
captureMessage('User completed onboarding', 'info');

Severity levels: fatal, error, warning, info, debug.

Adding Context

setUser

Associate errors with the current user so you can see which users are affected:

import { setUser } from '@codmir/overseer';

setUser({
  id: user.id,
  email: user.email,
  username: user.name,
});

Call setUser(null) on logout to clear user context.

addBreadcrumb

Record user actions leading up to an error. Breadcrumbs are attached to the next captured event:

import { addBreadcrumb } from '@codmir/overseer';

addBreadcrumb({
  category: 'ui.click',
  message: 'User clicked "Deploy" button',
  level: 'info',
  data: { page: '/dashboard', buttonId: 'deploy-btn' },
});

Breadcrumbs create a timeline of events before the error, making debugging significantly faster.

Filtering Errors

Skip noisy errors that you do not want to track:

import { init } from '@codmir/overseer';

init({
  dsn: 'https://your-project.codmir.com/overseer',
  service: 'my-app',
  environment: 'production',
  beforeSend(event) {
    const skipPatterns = [
      'ResizeObserver loop',
      'ChunkLoadError',
      'Loading chunk',
    ];

    if (skipPatterns.some((p) => event.message?.includes(p))) {
      return null;
    }

    return event;
  },
});

Viewing Errors in the Dashboard

Once errors are captured, they appear at Project > Issues in the Codmir dashboard.

Each issue shows:

  • Stack trace with source-mapped file paths
  • Breadcrumbs timeline of user actions before the error
  • User context who was affected
  • Environment production, staging, or development
  • Occurrence count how many times this error has happened
  • Affected users how many distinct users hit this error

Overseer automatically groups duplicate errors by stack trace fingerprinting. The first occurrence creates an issue; subsequent occurrences increment the count.

Next Steps