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

peer-devicer

v0.1.3

Published

Peer Reputation Networking Middleware for the FP-Devicer Intelligence Suite

Downloads

37

Readme

peer-devicer

Peer Reputation Networking Middleware for the FP-Devicer Intelligence Suite.
Developed by Gateway Corporate Solutions.


Overview

peer-devicer enriches every DeviceManager.identify() call with a peer graph score — linking device identifiers that share common signals (IP subnet, user account, JA4 TLS fingerprint, canvas hash, WebGL hash) and propagating ip/tls reputation through the graph as a confidence adjustment.

What it does

| Step | Description | |------|-------------| | Signal extraction | Extracts IP /24 subnet, user ID, JA4, canvas, and WebGL from each request. | | Graph construction | Builds/updates canonical PeerEdge records linking devices that share any signal. | | Reputation propagation | Loads the cached ip-risk / TLS-consistency / drift scores of each peer, then computes a weighted taintScore and trustScore for the current device. | | Confidence adjustment | Emits a peerConfidenceBoost delta (−20 → +10 pts) which DeviceManager applies to the match confidence. |


Installation

Install peer-devicer as a standalone package:

npm install peer-devicer

Install peer-devicer with FP-Devicer:

npm install devicer.js peer-devicer

Install the full Devicer Intelligence Suite meta-package:

npm install @gatewaycorporate/devicer-intel

Optional peer dependencies (install the ones matching your storage choice):

npm install better-sqlite3   # SQLite adapter
npm install ioredis           # Redis adapter
npm install pg                # PostgreSQL adapter

Quick start

import { DeviceManager }  from 'devicer.js';
import { IpManager }      from 'ip-devicer';
import { TlsManager }     from 'tls-devicer';
import {
  PeerManager,
  createPeerMiddleware,
} from 'peer-devicer';

// ── Initialise plugins ──────────────────────────────────────
const deviceManager = new DeviceManager({ /* … */ });

const ipManager  = new IpManager({ licenseKey: process.env.DEVICER_LICENSE_KEY });
const tlsManager = new TlsManager({ licenseKey: process.env.DEVICER_LICENSE_KEY });
const peerManager = new PeerManager({ licenseKey: process.env.DEVICER_LICENSE_KEY });

// Register ip-devicer and tls-devicer FIRST so their enrichmentInfo
// is available when peer-devicer runs (post-processor ordering matters).
ipManager.registerWith(deviceManager);
tlsManager.registerWith(deviceManager);
peerManager.registerWith(deviceManager);   // ← peer runs last

await Promise.all([
  ipManager.init(),
  tlsManager.init(),
  peerManager.init(),
]);

// ── Express middleware ──────────────────────────────────────
app.use(createPeerMiddleware());   // attaches req.peerContext

// ── In your route handler ────────────────────────────────────
app.post('/identify', async (req, res) => {
  const result = await deviceManager.identify(req.body, req.peerContext);
  // result.peerReputation      — { peerCount, taintScore, trustScore, factors, … }
  // result.peerConfidenceBoost — e.g. −12 (tainted cluster) or +8 (clean peers)
  res.json(result);
});

Storage adapters

| Adapter | Import | Use case | |---------|--------|----------| | In-memory (default) | built-in | Dev / testing / single-process | | SQLite | createSqliteAdapter | Single-process production | | PostgreSQL | createPostgresAdapter | Multi-process / HA | | Redis | createRedisAdapter | Distributed / low-latency |

import { createSqliteAdapter } from 'peer-devicer';

const peerManager = new PeerManager({
  licenseKey: process.env.DEVICER_LICENSE_KEY,
  storage: createSqliteAdapter('/data/peers.db'),
});

Plugin pipeline

peer-devicer registers as a DeviceManager post-processor named 'peer'. It must run after ip-devicer and tls-devicer so it can read their cached enrichment data:

identify(payload, context)
   │
  ├─ network bundle reference
  │  ├─ 'ip'  post-processor  (ip-devicer)
  │  │     └─> enrichmentInfo.details.ip.riskScore
  │  └─ 'tls' post-processor  (tls-devicer)
  │        └─> enrichmentInfo.details.tls.consistencyScore
   │
   └─ 'peer' post-processor (peer-devicer) ← register last
         ├─ builds / updates peer graph
         ├─ computes taintScore / trustScore
         └─> result.peerReputation + result.peerConfidenceBoost

Enrichment result shape

{
  peerReputation: {
    peerCount:       number;   // number of graph neighbours
    taintScore:      number;   // 0–100, higher = more tainted peers
    trustScore:      number;   // 0–100, higher = more trustworthy peers
    isNewDevice:     boolean;  // true when no peer edges exist yet
    factors:         string[]; // 'high_taint_peers' | 'known_bot_cluster' | ...
    peerEdges:       PeerEdge[];
    confidenceBoost: number;
  },
  peerConfidenceBoost: number, // confidence delta applied to DeviceManager result
}

License tiers

| Tier | Price | Devices | Edge types | Edges / device | |------|-------|---------|------------|----------------| | Free | $0 | 10,000 | user + IP subnet | 10 | | Pro | $49 / mo | Unlimited | All 5 types | 50 (configurable) | | Enterprise | $299 / mo | Unlimited | All 5 types | Unlimited |

You can obtain a license key through polar.sh here

Without a key the library runs on the free tier automatically and logs a warning at startup.


API reference

This project uses TypeDoc and publishes documentation at gatewaycorporate.github.io/peer-devicer.


License

Business Source License 1.1 — see license.txt.