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

@askdepth/replay

v0.3.0

Published

Askdepth session replay — rrweb wrapper with a 45s ring buffer.

Downloads

414

Readme

@askdepth/replay

High-performance, privacy-by-default Session Replay recorder built for Askdepth SDK.

  • 45-second In-Memory Ring Buffer: Retains rolling session state without writing to disk or sending continuous streams.
  • Zero-PII Client Masking: Real-time redactor for credit cards (Luhn-verified), JWTs, Bearer tokens, API keys, passwords, emails, phone numbers, passport IDs, and sensitive query/CSS URLs.
  • Strict Block Allowlist: Blocked elements ([data-askdepth-block], .askdepth-block) completely purge class, id, style, src, href, data-*, and all child nodes.
  • W3C Keepalive-Safe Transport: Slices are chunked into $\le 45\text{ KiB}$ parts ($\le 60\text{ KiB}$ with base64 + JSON manifest), guaranteeing safe delivery during page unload within the browser's 64 KiB quota.
  • Flash-to-Server On Demand: Flashes the last 45s of DOM mutations upon frustration heuristics (Rage Click, Dead Click, Error Click) from @askdepth/core.
  • Lightweight Budget: $\le 31.5\text{ kB}$ minified & gzipped (well under the 35 kB size budget).

Installation

pnpm add @askdepth/replay @askdepth/contracts

When using @askdepth/core, @askdepth/replay is automatically dynamically loaded on idle or pre-loaded on friction signals when replay: true is enabled.


Direct Usage

import { createReplayEngine } from '@askdepth/replay';

const replay = createReplayEngine({
  sessionId: '550e8400-e29b-41d4-a716-446655440000',
  environment: 'production',
  endpoint: 'https://collector.example.com/v1/replays/upload',
  checkoutEveryNms: 45_000,
});

// Start recording
replay.start();

// Flush a 45s slice when an anomaly occurs
await replay.flash('anomaly_uuid');

// Stop and clean up memory
replay.stop();

Privacy & Masking Attributes

| Attribute / Class | Effect | |---|---| | [data-askdepth-block], .askdepth-block | Complete block: scrubs all attributes except dimensions, removes all children. | | [data-askdepth-mask], .askdepth-mask | Replaces text with asterisks * preserving layout length. | | input, textarea, select | Masked by default (*), emails/cards redacted with semantic markers. | | [contenteditable] | Tracked statefully; all character mutations masked to *. |


Configuration Options

| Option | Type | Default | Description | |---|---|---|---| | sessionId | string | (required) | Active session UUID. | | environment | string | (required) | Deployment environment (production, etc.). | | endpoint | string | (required) | Ingest server upload endpoint. | | windowMs | number | 45000 | Rolling memory window duration (ms). | | checkoutEveryNms | number | 45000 | FullSnapshot checkpoint frequency. | | maxBytes | number | 3 MiB (desktop), 1.5 MiB (mobile/WebKit) | Upper memory bound before dropping pointer/scroll events. |


Architecture

See docs/SPRINT_2_REPLAY_SPEC.md for detailed technical specifications and invariants.