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

@nexly/web

v0.15.3

Published

Nexly browser ingest SDK: sendBeacon transport, DOM metadata, engagement listeners on top of @nexly/core

Readme

@nexly/web

Browser ingest SDK for Nexly: sendBeacon transport, DOM metadata, engagement listeners. Implements the abstract NexlyBase from @nexly/core for the browser runtime.

Install

npm install @nexly/web

Usage

import { Nexly } from '@nexly/web'

const client = Nexly.init({
  appId: 'your-app-id',
  key: 'your-ingest-key',
})

client.pageview()
client.event({ name: 'cta_clicked', type: 'custom', data: { placement: 'hero' } })

const stopEngagement = client.startEngagement()
// stopEngagement() on SPA unmount / route change if needed

startEngagement() is idempotent — calling it again stops the previous subscription first, so HMR or double-mounts can't produce duplicate listeners.

Opting elements out of auto-capture

Auto-click and auto-focus listeners skip any element (or descendant of an element) marked with data-nexly-ignore. Use it on elements where you already emit your own event(...) to avoid semantic duplicates:

<button data-nexly-ignore onClick={() => client.event({ name: 'signup_clicked', type: 'custom' })}>
  Sign up
</button>

What you get

  • Nexly — browser client (auto session + visitor IDs via localStorage/sessionStorage).
  • collectSessionMeta(), collectEventMeta(), collectBrowserMeta() — reusable metadata collectors.
  • startEngagementTracking(creds) — standalone engagement attach (scroll / click / focus / visibility / keepalive).
  • sendBeaconCollect(input) — raw sendBeacon helper.

For React bindings use @nexly/react-web; for Next.js App Router use @nexly/next; for React Native use @nexly/react-native; for Node.js servers use @nexly/node.

Linking backend events to this visitor

If you also emit server-side events with @nexly/node and want them to show up on the same user timeline as browser activity, forward the browser's Nexly visitor id to your backend once (on sign-up / login), persist it next to your own user record, and pass it through in context when emitting backend events.

import { getVisitorId, getSessionId } from '@nexly/web'

// once per signed-in user — send to your own backend
await fetch('/api/link-visitor', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    visitorId: getVisitorId(),
    sessionId: getSessionId(), // optional
  }),
})

getVisitorId() reads the persistent anonymous id Nexly stores in localStorage; getSessionId() reads the 30-minute tab session id from sessionStorage. Both are plain strings, safe to call from anywhere.

See the full recipe (backend storage + emitting linked events) in the @nexly/node README.

Bot detection

Bots and AI crawlers are classified server-side from the HTTP User-Agent header at ingest — do not try to compute or send an is_bot flag from your page code. Every event is stored (bots are not filtered out); the dashboard surfaces them in the dedicated "AI & Crawler activity" section and excludes them from standard visitor metrics.