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

webagent-sdk

v0.1.0

Published

WebAgent AI browser SDK — silently observes user behavior and turns it into business insights. Zero runtime dependencies, < 35 KB gzip.

Readme

webagent-sdk

The WebAgent AI browser SDK — silently observes user behaviour and turns it into plain-English business insights.

Zero runtime dependencies. < 35 KB gzip. Never blocks the host page.

Install

npm install webagent-sdk
# or
pnpm add webagent-sdk
# or
yarn add webagent-sdk

Or via CDN (drop-in snippet, no build step — served from jsDelivr):

<script src="https://cdn.jsdelivr.net/npm/webagent-sdk/dist/webagent.iife.js"></script>
<script>
  WebAgent.init({ apiKey: "wa_live_xxxxxx" });
</script>

Usage

One function call activates everything:

import { init } from "webagent-sdk";

init({ apiKey: "wa_live_xxxxxx" });

Custom events

const webagent = init({ apiKey: "wa_live_xxxxxx" });

webagent.track("video_started", { title: "Product tour", duration: 45 });

GDPR / cookie consent

// When consentRequired is set, nothing is sent until consent is granted.
init({ apiKey: "wa_live_xxxxxx", consentRequired: true });

// From your consent banner:
webagent.setConsent(true); // or false to revoke

Options

| Option | Type | Default | Description | | ----------------- | --------- | --------------------------------- | -------------------------------------------------- | | apiKey | string | — (required) | Site-scoped live key (wa_live_...) | | endpoint | string | https://collect.webagent.ai/v1 | Collector base URL | | enabled | boolean | true | Master kill-switch | | consentRequired | boolean | false | GDPR mode — waits for setConsent(true) | | sampleRate | number | 1 | 0..1 traffic sampling | | maskIdentity | boolean | false | Skip UA parsing | | maskPaths | boolean | false | Strip URLs/paths from payloads | | disabledTrackers| object | {} | Disable specific trackers by event type | | flushIntervalMs | number | 5000 | Batch flush interval |

What is tracked automatically

Page views · SPA route changes · clicks · link clicks · rage clicks · dead clicks · scroll depth · mouse heatmap · form submits · copy/paste · keystroke volume · time on page · exit intent · visibility changes · JS errors · console errors · unhandled rejections · network failures · Core Web Vitals (LCP, CLS, INP, FCP, TTFB) · slow resources · custom events.

Privacy & performance

  • No cookies are set by the SDK; identity uses localStorage/sessionStorage only.
  • Events are batched (≤ 10 KB) and flushed with sendBeacon during pagehide so nothing is lost when the tab closes.
  • Mouse movement is sampled at 5 Hz into a bounded ring buffer; heatmaps ship once per page view.
  • Every browser API call is defensive — the SDK cannot crash or block the host page.

Development

pnpm --filter webagent-sdk build   # ESM + CJS + IIFE
pnpm --filter webagent-sdk test    # vitest
pnpm --filter webagent-sdk check-size  # enforces the 35 KB gzip budget