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

@camada/browser

v0.3.1

Published

camada fingerprint beacon: browser module + self-initializing IIFE served first-party by the backend SDKs

Readme

@camada/browser

The camada fingerprint beacon as a TypeScript package: a browser module plus a self-initializing IIFE build that backend SDKs serve first-party.

It collects device, engine, automation and interaction signals in the visitor's browser, waits ~2 seconds for human input, then POSTs a single JSON payload to a same-origin endpoint (and again on pagehide). No cookies read, no storage written, no third-party calls.

Wire payload

The analyst's feedBeacon() (edge-analyst/src/features.js) reads the payload by key, so the top-level keys are pinned (test/beacon.test.ts guards them): sdk, rid, ts, scr, win, dpr, tz, tzo, lang, langs, plat, cores, mem, touch, ua, dnt, cookies, conn, gl, cv, mf, auto, vis, focus, timing, paint, input, plus hi (high-entropy client hints) when the browser answers in time.

sdk is "@camada/browser/<version>" — the beacon's own build, stamped at build time. sendBeacon cannot set headers, so this is how the analyst's freshness learns which beacon a project runs (the server SDKs report themselves through x-camada-sdk); the dashboard uses it to flag an outdated beacon. A b.js cached from before 0.2.0 sends no sdk and is simply not versioned.

Install

npm install @camada/browser

Quickstart

Programmatic init (bundled into your own app code):

import { initBeacon } from '@camada/browser';

initBeacon({ endpoint: '/_cam/fp', rid: pageViewRequestId });
  • endpoint — same-origin path the payload is POSTed to.
  • rid (optional) — request id correlating the beacon with the page view that served it; null on the wire when absent.

Self-initializing script (no bundler on the page): serve dist/auto.global.js as a classic <script src>. It reads its own script URL — the r query param becomes the rid, and the URL's final path segment is replaced with fp to form the endpoint (/_cam/b.js?r=abc → POST /_cam/fp with rid: "abc"). If document.currentScript is unavailable it does nothing, silently.

Serving from a backend SDK

This is the intended production path, and @camada/node, @camada/next and @camada/hono already do it: each serves the built IIFE first-party at its scriptPath (/_cam/b.js; @camada/next uses /api/camada/b.js), accepts the beacon at the sibling fpPath (/_cam/fp, at most 32 KB, answers 204) and ships it inside its event batch as a sig: 1 row stamped with the client IP it resolved itself and its own tap — one request per flush at the analyst, not one per page view. Both endpoints sit behind the SDK's verdict (a blocked client gets 403). When the project turns the beacon off in its settings all three adapters stand both endpoints down (a cached b.js may still post until its cache expires; the relay drops it).

The fpPath must live in the scriptPath's directory: the self-initializing script derives the POST target by replacing the last segment of its own URL with fp. Move both when mounting under a prefix.

npm run build embeds dist/auto.global.js as a string, importable without filesystem access, which is what the SDKs serve:

import beaconSource from '@camada/browser/iife-string';

// e.g. in your own route handler:
res.setHeader('content-type', 'application/javascript');
res.setHeader('cache-control', 'public, max-age=3600');
res.end(beaconSource);

The SDK packages mark this import external, so they need no rebuild — but the import is resolved where the application is bundled: a Worker inlines the IIFE at wrangler deploy and a Next app at next build, so redeploy those after rebuilding this package; a plain-Node process picks the new dist/ up on restart. @camada/browser/iife resolves to the raw dist/auto.global.js file for setups that prefer serving the file itself.

Development

npm install
npm run build   # tsup (ESM + CJS + IIFE) + dist/iife-string.{js,cjs,d.ts}
npm test        # vitest (jsdom)
npm run check   # tsc --noEmit