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

@devskin/browser-sdk

v1.0.40

Published

DevSkin Browser SDK for complete user analytics and monitoring with rrweb session recording

Downloads

5,098

Readme

DevSkin Browser SDK

Comprehensive browser monitoring SDK for collecting user analytics, performance metrics, errors, and session recordings.

Features

  • 📊 Product Analytics: Track custom events, page views, and user behavior
  • 🎯 Session Recording: Record and replay user sessions with privacy controls
  • Performance Monitoring: Collect Core Web Vitals (LCP, FID, CLS, FCP, TTFB)
  • 🐛 Error Tracking: Automatic error capture with breadcrumbs and context
  • 🌐 Network Monitoring: Track all network requests (fetch, XHR)
  • 📱 Device Detection: Comprehensive device, browser, and OS information
  • 🌍 Geolocation: Optional location tracking with user permission
  • 🔒 Privacy-First: Built-in privacy controls and data masking

Installation

Via CDN

<!-- Via unpkg -->
<script src="https://unpkg.com/@devskin/browser-sdk@latest/dist/devskin.umd.min.js"></script>

<!-- Or via jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/@devskin/browser-sdk@latest/dist/devskin.umd.min.js"></script>

<script>
  DevSkin.init({
    apiKey: 'your-api-key',
    appId: 'your-app-id',
    apiUrl: 'https://api-monitoring.devskin.com', // Required!
  });
</script>

Via npm

npm install @devskin/browser-sdk
import DevSkin from '@devskin/browser-sdk';

DevSkin.init({
  apiKey: 'your-api-key',
  appId: 'your-app-id',
  apiUrl: 'https://api-monitoring.devskin.com', // Required!
});

Configuration

DevSkin.init({
  // Required
  apiKey: 'your-api-key',
  appId: 'your-app-id',
  apiUrl: 'https://api-monitoring.devskin.com', // IMPORTANT: Backend URL (Required!)

  // Optional
  debug: false,
  environment: 'production',
  release: '1.0.0',

  // Feature flags
  captureWebVitals: true,
  captureNetworkRequests: true,
  captureErrors: true,
  captureUserAgent: true,
  captureLocation: true,
  captureDevice: true,

  // Session Recording
  sessionRecording: {
    enabled: true,
    maskAllInputs: true,
    maskTextSelector: '.sensitive',
    blockSelector: '.private',
    sampling: 0.1, // Record 10% of sessions
    recordCanvas: false,
    recordCrossOriginIframes: false,
    ignoreClass: 'devskin-block',
  },

  // Heatmap & User Behavior
  heatmapOptions: {
    enabled: true,
    trackClicks: true, // Track click heatmaps
    trackScroll: true, // Track scroll depth
    trackMouseMovement: false, // Track mouse movement (can be heavy)
    mouseMoveSampling: 0.1, // Sample 10% of mouse movements
  },

  // Network options
  networkRequestOptions: {
    ignoreUrls: [/analytics\.google\.com/],
    captureHeaders: false,
    captureBody: false,
    captureFailedOnly: false,
  },

  // Error options
  errorOptions: {
    ignoreErrors: [/Script error/i],
    denyUrls: [/extensions\//],
    includeLocalVariables: true,
    maxBreadcrumbs: 30,
  },

  // Privacy
  privacy: {
    respectDoNotTrack: true,
    cookieConsent: false,
  },

  // Long task threshold (ms)
  longTaskThreshold: 50,

  // Callbacks
  beforeSend: (event) => {
    // Modify or filter events before sending
    return event;
  },
});

Usage

Track Events

// Track a custom event
DevSkin.track('button_clicked', {
  buttonId: 'signup',
  page: '/landing',
});

// Track page view
DevSkin.trackPageView({
  title: 'Home Page',
});

Identify Users

DevSkin.identify('user-123', {
  name: 'John Doe',
  email: '[email protected]',
  plan: 'premium',
});

Capture Errors

try {
  // Your code
} catch (error) {
  DevSkin.captureError(error, {
    context: 'checkout_process',
    step: 'payment',
  });
}

Add Breadcrumbs

DevSkin.addBreadcrumb({
  category: 'ui',
  message: 'User clicked submit button',
  level: 'info',
  data: {
    formId: 'checkout-form',
  },
});

Control Recording

// Start recording
DevSkin.startRecording();

// Stop recording
DevSkin.stopRecording();

Privacy Controls

// Opt out
DevSkin.optOut();

// Opt in
DevSkin.optIn();

Data Collected

Automatic Data Collection

The SDK automatically collects:

  • Browser Info: Name, version, engine, language, viewport size
  • Device Info: Type (mobile/tablet/desktop), OS, screen resolution, memory, CPU cores
  • Location Info: URL, hostname, pathname, referrer, timezone
  • Performance Metrics: Core Web Vitals, navigation timing, resource timing
  • Network Requests: URL, method, status, duration, size
  • Errors: Message, stack trace, breadcrumbs, context
  • User Actions: Clicks, navigation, console logs
  • Heatmap Data: Click positions, scroll depth, mouse movement (if enabled)

Optional Data Collection

With user permission:

  • Geolocation: Country, region, city, latitude, longitude
  • Session Recordings: Full DOM replay with privacy controls

Privacy & Security

Data Masking

  • All password inputs are automatically masked
  • Email addresses are masked by default
  • Use CSS classes to mask sensitive data:
    • .devskin-mask - Mask text content
    • .devskin-block - Completely block element from recording

Sampling

Record only a percentage of sessions to reduce data collection:

sessionRecording: {
  enabled: true,
  sampling: 0.1, // Record 10% of sessions
}

Do Not Track

Respect browser DNT settings:

privacy: {
  respectDoNotTrack: true,
}

Cookie Consent

Wait for cookie consent before tracking:

privacy: {
  cookieConsent: true,
}

// Later, after consent is given:
DevSkin.optIn();

Browser Support

  • Chrome/Edge: Latest 2 versions
  • Firefox: Latest 2 versions
  • Safari: Latest 2 versions
  • Mobile browsers: iOS Safari 12+, Chrome Android

Performance Impact

The SDK is designed for minimal performance impact:

  • Async initialization
  • Efficient event batching
  • Lazy loading of features
  • Compressed payloads
  • ~15KB gzipped

Development

# Install dependencies
npm install

# Development build with watch
npm run dev

# Production build
npm run build

# Type checking
npm run type-check

License

MIT License

Support

For issues and questions, please visit: https://github.com/devskin/browser-sdk