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

@azfive/capture

v0.1.0

Published

Capture product-analytics events from the browser or Node — the official AzFive analytics SDK

Readme

@azfive/capture

Capture product-analytics events into AzFive from the browser or Node — a batteries-included analytics SDK: anonymous-id persistence, identify/reset, super properties, batching with sendBeacon on unload, and autocapture (az.page_view/az.page_leave + DOM clicks).

Install / build

npm install      # in this directory
npm run build    # emits dist/ (ES + UMD + .d.ts)
npm test         # vitest (jsdom)

This is a standalone package (not part of the app's npm workspace), mirroring sdk/ (@azfive/embed).

Browser quickstart

Create a public ingest token in AzFive → Settings → API Keys → Public Ingest Tokens (scoped to your site's origins). It's safe to ship in page source.

import { init, azfive } from '@azfive/capture';

init('azfive_pub_…', { host: 'https://analytics.example.com', project: 'web' });

azfive.capture('signed_up', { plan: 'pro' });
azfive.identify('[email protected]', { plan: 'pro' });   // merges the anon session

// on logout:
await azfive.flush();
azfive.reset();

Autocapture (az.page_view, az.page_leave, DOM az.interaction clicks) is on by default. Mark sensitive elements with data-vz-no-capture (or .vz-no-capture); password/hidden inputs are never captured. Disable per-feature:

init(token, { autocapture: false, captureClicks: false });

React

The SDK is framework-agnostic — initialize a singleton once and import it anywhere:

// analytics.ts
import { createClient } from '@azfive/capture';
export const analytics = createClient('azfive_pub_…', { host: 'https://analytics.example.com' });

// any component
import { analytics } from './analytics';
analytics.capture('clicked_cta');

Node (server-side)

Use a secret events:write API key and supply the distinct_id yourself; no persistence/autocapture runs.

import { createClient } from '@azfive/capture';

const azfive = createClient('unused', { host: 'https://analytics.example.com', secretKey: 'azfive_…' });
azfive.capture('invoice_paid', { distinct_id: 'user-42', amount: 99 });
await azfive.flush();

API

init / createClient · capture · identify · alias · reset · getDistinctId · register / register_once / unregister (super properties) · people.set / people.set_once · opt_in_capturing / opt_out_capturing / has_opted_out_capturing · flush · destroy.

See docs/events.md for the end-to-end events architecture.