npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@error-explorer/browser

v1.2.0

Published

Error Explorer SDK for Browser - Automatic error tracking and breadcrumbs

Readme

@error-explorer/browser

Official Error Explorer SDK for Browser. Automatically captures errors, unhandled promise rejections, and provides detailed context through breadcrumbs.

Features

  • 🔄 Automatic error capture - window.onerror, unhandled promise rejections
  • 🍞 Breadcrumbs - Track clicks, navigation, network requests, console logs
  • 🧑 User context - Associate errors with user information
  • 📦 Offline support - Queue events when offline, send when back online
  • 🔒 Data scrubbing - Automatically filter sensitive data (passwords, tokens, etc.)
  • Non-blocking - Uses sendBeacon and fetch with keepalive
  • 🎯 Small footprint - < 10KB gzipped

Installation

# npm
npm install @error-explorer/browser

# yarn
yarn add @error-explorer/browser

# pnpm
pnpm add @error-explorer/browser

Quick Start

import ErrorExplorer from '@error-explorer/browser';

// Initialize (1 line!)
ErrorExplorer.init({
  token: 'ee_your_project_token',
  environment: 'production',
  release: '1.0.0',
});

// That's it! Errors are now captured automatically.

CDN Usage

<script src="https://cdn.error-explorer.com/sdk.min.js"></script>
<script>
  ErrorExplorer.init({
    token: 'ee_your_project_token',
    environment: 'production',
  });
</script>

Configuration

ErrorExplorer.init({
  // Required
  token: 'ee_your_project_token',

  // Recommended
  environment: 'production',  // or 'staging', 'development'
  release: '1.2.3',           // Your app version

  // Auto capture (all true by default)
  autoCapture: {
    errors: true,              // window.onerror
    unhandledRejections: true, // Promise rejections
    console: true,             // console.error
  },

  // Breadcrumbs (all true by default except inputs)
  breadcrumbs: {
    enabled: true,
    maxBreadcrumbs: 20,
    clicks: true,              // Click events
    navigation: true,          // Route changes
    fetch: true,               // Fetch requests
    xhr: true,                 // XMLHttpRequest
    console: true,             // Console logs
    inputs: false,             // Input focus (privacy)
  },

  // Filtering
  ignoreErrors: [/ResizeObserver/],
  denyUrls: [/chrome-extension/],
  allowUrls: [],               // If set, only these URLs

  // Hooks
  beforeSend: (event) => {
    // Modify or filter events
    if (event.message.includes('ignore')) {
      return null; // Drop event
    }
    return event;
  },

  // Transport
  maxRetries: 3,
  timeout: 5000,
  offline: true,              // Queue when offline

  // Debug
  debug: false,
});

Manual Capture

// Capture an exception
try {
  riskyOperation();
} catch (error) {
  ErrorExplorer.captureException(error, {
    tags: { feature: 'checkout' },
    extra: { orderId: '12345' },
  });
}

// Capture a message
ErrorExplorer.captureMessage('User completed onboarding', 'info');

User Context

// Set user (after login)
ErrorExplorer.setUser({
  id: 'user_123',
  email: '[email protected]',
  name: 'John Doe',
  plan: 'pro', // Custom fields allowed
});

// Clear user (after logout)
ErrorExplorer.clearUser();

Tags & Extra Data

// Set tags (for filtering in dashboard)
ErrorExplorer.setTags({
  feature: 'checkout',
  ab_test: 'variant_b',
});

// Set a single tag
ErrorExplorer.setTag('version', '2.0');

// Set extra data (appears in error details)
ErrorExplorer.setExtra({
  cartTotal: 149.99,
  itemCount: 3,
});

// Set a named context
ErrorExplorer.setContext('cart', {
  items: ['SKU-1', 'SKU-2'],
  total: 149.99,
});

Manual Breadcrumbs

// Add a custom breadcrumb
ErrorExplorer.addBreadcrumb({
  type: 'user-action',
  category: 'ui',
  message: 'User clicked "Add to Cart"',
  level: 'info',
  data: {
    productId: 'SKU-123',
    price: 29.99,
  },
});

Automatic Breadcrumbs

The SDK automatically captures:

| Type | Data | |------|------| | click | Element tag, id, classes, text | | navigation | From URL, To URL, navigation type | | fetch | Method, URL, status, duration | | xhr | Method, URL, status, duration | | console | Level, message | | input | Element type, name (never the value!) |

Flushing & Cleanup

// Flush pending events (before page unload)
await ErrorExplorer.flush(5000); // 5s timeout

// Close SDK and cleanup
await ErrorExplorer.close();

TypeScript Support

Full TypeScript support with exported types:

import ErrorExplorer, {
  InitOptions,
  UserContext,
  Breadcrumb,
  CaptureContext,
  SeverityLevel,
} from '@error-explorer/browser';

const user: UserContext = {
  id: '123',
  email: '[email protected]',
};

ErrorExplorer.setUser(user);

Framework Integrations

For framework-specific features, use our dedicated packages:

  • React: @error-explorer/react - ErrorBoundary, hooks
  • Vue: @error-explorer/vue - Plugin, composables
  • Angular: @error-explorer/angular - Module, ErrorHandler
  • Next.js: @error-explorer/nextjs - App Router support

Privacy & Security

  • No PII by default: Input values are never captured
  • Data scrubbing: Passwords, tokens, API keys are automatically filtered
  • Configurable: Add custom scrub fields via configuration
  • GDPR friendly: User consent can be managed via beforeSend

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 11+
  • Edge 79+

License

MIT