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

@vigilkids/device-fingerprint

v0.1.0

Published

Browser device fingerprint and platform standard client headers for VigilKids frontend applications

Readme

@vigilkids/device-fingerprint

Browser device fingerprint and platform standard client headers for VigilKids / Visiva frontend applications. Built on FingerprintJS v4 (MIT, open-source).

Features

  • Deterministic fingerprint — same hash in normal and incognito mode (canvas/webgl/audio signals)
  • Memory-only cache — no cookie/localStorage dependency, recomputes on page load (~50ms)
  • Platform headers — generates X-Device-ID, X-Client-Type, X-Client-Platform, X-Product-Code headers
  • Multi-product — works with any VigilKids product (vigilkids, visiva, etc.)

Install

pnpm add @vigilkids/device-fingerprint

Usage

Client Headers (recommended)

Most use cases only need getClientHeaders — it computes the fingerprint internally and returns all standard headers:

import { getClientHeaders } from '@vigilkids/device-fingerprint'

const headers = await getClientHeaders({
  productCode: 'visiva',
  appVersion: '1.0.0',  // optional
})
// {
//   'X-Device-ID': 'a1b2c3d4e5f6...',
//   'X-Client-Type': 'web',
//   'X-Client-Platform': 'web',
//   'X-Product-Code': 'visiva',
//   'X-Client-Version': '1.0.0',
// }

Raw Fingerprint

For direct access to the fingerprint result:

import { getDeviceFingerprint } from '@vigilkids/device-fingerprint'

const { visitorId, confidence } = await getDeviceFingerprint()
// visitorId: hex string (FingerprintJS hash)
// confidence: 0-1 (higher = more reliable)

Reset Cache

Force recomputation on next call (typically not needed):

import { resetFingerprint } from '@vigilkids/device-fingerprint'

resetFingerprint()

Exports

| Entry Point | Import | Content | |-------------|--------|---------| | Main | @vigilkids/device-fingerprint | getDeviceFingerprint, getClientHeaders, resetFingerprint | | Types | @vigilkids/device-fingerprint/types | DeviceFingerprintResult, ClientHeaderOptions |

How It Works

getClientHeaders()
  └─ getDeviceFingerprint()
       └─ FingerprintJS.load()  → agent (singleton, cached)
            └─ agent.get()      → { visitorId, confidence }
                                    ↓ (memory cache)
       └─ return cached result
  └─ build headers map with X-Device-ID = visitorId

The fingerprint is computed from browser hardware signals (canvas rendering, WebGL renderer, audio context, etc.). These signals are consistent across normal and incognito sessions on the same device/browser combination.

Backend Integration

The generated headers are consumed by the OneX backend middleware chain:

  1. ClientContextMiddleware extracts X-Device-IDClientContext.DeviceID
  2. SessionService.Create() stores DeviceID in p_identity_sessions.device_id
  3. Audit and promotion modules use the device ID for logging and fraud analysis

Compatibility

  • Browser only (requires window, document, canvas)
  • ESM only
  • TypeScript >= 5.0

License

MIT