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 🙏

© 2025 – Pkg Stats / Ryan Hefner

overwatch-sdk

v0.0.7

Published

The most powerful web analytics software ever.

Readme

overwatch-sdk

Lightweight browser analytics SDK for comprehensive user behavior tracking. Silent, privacy-conscious, and production-ready.

Features

  • Page views, sessions, and user journeys
  • Click tracking with coordinates and element data
  • Core Web Vitals and performance metrics
  • Form interactions and field analytics
  • Scroll depth and reading behavior
  • JavaScript error monitoring
  • Device fingerprinting and environment data
  • Resource loading and network analysis
  • City-level location tracking via IP geolocation
  • 100% type-safe TypeScript
  • Universal browser support (IE11+)

Installation

npm install overwatch-sdk
# or
bun add overwatch-sdk
# or
yarn add overwatch-sdk

Quick Start

import { watch } from 'overwatch-sdk';

// Initialize with your API key
watch.init('your-api-key', {
  endpoint: 'https://ingest.overwatch.dev'  // Rust ingestion service
});

// Track user interactions
watch
  .identify('user-123')
  .page({ title: 'Dashboard' })
  .click('#buy-button')
  .track({ type: 'purchase', value: 99.99 });

// Get insights
const analytics = watch.getSnapshot();
const deviceInfo = await watch.getDeviceWithLocation();

API Reference

Initialization

// Basic setup
watch.init('api-key', {
  endpoint: 'https://ingest.overwatch.dev'
});

// Debug mode (verbose logging)
watch.debug('api-key', 'https://ingest.overwatch.dev');

// Performance optimized (10% sampling)
watch.performance('api-key');

// With location tracking
watch.withLocation('api-key');

Tracking Methods

// Identify users
watch.identify('user-id');

// Track page views
watch.page({ title: 'Home', path: '/home' });

// Track clicks
watch.click('#button-id', { text: 'Buy Now' });

// Track form interactions
watch.form('submit', 'checkout-form', 'email-field');

// Track errors
watch.error('Payment failed', { errorType: 'network' });

// Track custom events
watch.track({
  type: 'video_play',
  duration: 30,
  videoId: 'abc123'
});

Performance Measurement

// Synchronous timing
const result = watch.time('api-call', () => fetchData());

// Asynchronous timing
const data = await watch.timeAsync('db-query', () => queryDatabase());

Data Access

// Get performance score (0-100)
const score = watch.getPerformance();

// Get session info
const session = watch.getSession();

// Get device info
const device = watch.getDevice();
const deviceWithLocation = await watch.getDeviceWithLocation();

// Get complete snapshot
const snapshot = watch.getSnapshot();
const snapshotWithLocation = await watch.getSnapshotWithLocation();

Configuration

watch.init('api-key', {
  endpoint: 'https://ingest.overwatch.dev',  // Rust ingestion service
  debug: false,
  sampleRate: 1.0, // Track 100% of users
  batchSize: 50,
  flushInterval: 5000,
  enableAutoTracking: {
    pageViews: true,
    clicks: true,
    scrolling: true,
    forms: true,
    performance: true,
    errors: true,
    visibility: true,
    resources: true,
    location: false
  },
  locationConfig: {
    enableIpLocation: true,
    cacheLocation: true,
    timeout: 5000
  }
});

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+
  • IE 11+ (with polyfills)
  • Mobile browsers (iOS Safari, Chrome Mobile)

Event Types

| Event Type | Description | |------------|-------------| | pageview | Page loads with performance data | | pageleave | Time on page and scroll depth | | click | All clicks with element data | | scroll | Scroll depth tracking | | performance | Core Web Vitals (LCP, FID, CLS) | | error | JavaScript errors | | session_start | New sessions with device info | | form_* | Form interactions | | visibility_change | Tab visibility | | resource_load | Network resource timing |

Architecture

Browser → overwatch-sdk → POST /overwatch-ingest → Rust Service → ClickHouse

The SDK sends events to a high-throughput Rust ingestion service which writes to ClickHouse. A separate TS daemon provides query APIs for dashboards.

Privacy

  • No cookies by default - uses session storage
  • City-level location only - no precise GPS coordinates
  • Configurable sampling - track subset of users
  • Client-side processing - minimal data sent to server
  • Self-hosted option - full data control

License

MIT


Built with TypeScript | Zero dependencies | <10KB gzipped | Production ready