# server-side-fingerprint

> Generate a stable fingerprint hash of a server from its operating system data.

Latest version **2.0.1** (published 2026-11-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install server-side-fingerprint
pnpm add server-side-fingerprint
yarn add server-side-fingerprint
bun add server-side-fingerprint
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-11-05 |
| First published | 2023-05-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Marjanidze |
| Maintainers | davidmarjanidze |
| Keywords | fingerprint, device fingerprint, machine id, server |

## Links

- npm: https://www.npmjs.com/package/server-side-fingerprint
- Repository: https://github.com/davidmarjanidze/server-side-fingerprint
- Homepage: https://github.com/davidmarjanidze/server-side-fingerprint#readme
- Issues: https://github.com/davidmarjanidze/server-side-fingerprint/issues
- npm.io page: https://npm.io/package/server-side-fingerprint

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-11-05
- 2.0.0 — 2026-11-04
- 1.6.0 — 2023-06-10
- 1.5.0 — 2023-05-27
- 1.4.0 — 2023-05-27
- 1.3.0 — 2023-05-27
- 1.2.0 — 2023-05-27
- 1.1.0 — 2023-05-27
- 1.0.5 — 2023-05-26
- 1.0.4 — 2023-05-25
- 1.0.3 — 2023-05-25
- 1.0.2 — 2023-05-25
- 1.0.1 — 2023-05-25
- 1.0.0 — 2023-05-25

## README

# server-side-fingerprint

[![npm version](https://img.shields.io/npm/v/server-side-fingerprint.svg)](https://www.npmjs.com/package/server-side-fingerprint)
[![license](https://img.shields.io/npm/l/server-side-fingerprint.svg)](https://www.npmjs.com/package/server-side-fingerprint)

Generates a fingerprint hash of the machine your Node.js code runs on, using
data from the `node:os` module. The same machine and user give the same hash.

Works with both `import` and `require`. Requires Node.js 18 or newer.

## Installation

```console
npm i server-side-fingerprint
```

## Usage

```ts
import { generateFingerprint } from 'server-side-fingerprint'

generateFingerprint()
// 'a8dcbd41d881bd32d26956c0f87de53b51aa4cf3dbc613931e248c641144acf7'

generateFingerprint({ algorithm: 'md5' })
// 'dd92f2efbef99710a3aad4c148fe4581'

// Keep the same fingerprint after OS updates
generateFingerprint({ exclude: ['release', 'version'] })
```

## What goes into the hash

`generateFingerprintData()` returns the data that gets hashed. On a Mac it
looks like this:

```json
{
  "arch": "arm64",
  "cpus": ["Apple M4", "Apple M4", "Apple M4", "Apple M4"],
  "endianness": "LE",
  "hostname": "my-laptop.local",
  "machine": "arm64",
  "platform": "darwin",
  "release": "25.5.0",
  "totalmem": 17179869184,
  "type": "Darwin",
  "userInfo": {
    "username": "john",
    "uid": 501,
    "gid": 20,
    "homedir": "/Users/john",
    "shell": "/bin/bash"
  },
  "version": "Darwin Kernel Version 25.5.0: ..."
}
```

The fingerprint changes when any of these change. For example, when the
hostname is renamed, the OS is updated, or the code runs as a different
user. Use the `exclude` option to leave out the fields you don't care about.

## API

### generateFingerprint(options?)

- `options.algorithm` - any hash algorithm supported by `crypto.createHash`.
  Default: `'sha256'`.
- `options.exclude` - list of fields from `FingerprintData` to leave out of the
  hash. Default: `[]`.
- Returns: `string` (hex)

Throws if the algorithm isn't supported.

### generateFingerprintData()

- Returns: `FingerprintData`

### Types

```ts
interface FingerprintData {
  arch: string
  cpus: string[] // CPU model of each logical core
  endianness: 'BE' | 'LE'
  hostname: string
  machine: string
  platform: NodeJS.Platform
  release: string
  totalmem: number
  type: string
  userInfo: {
    username: string
    uid: number
    gid: number
    homedir: string
    shell: string | null
  }
  version: string
}

type FingerprintField = keyof FingerprintData

interface FingerprintOptions {
  algorithm?: string
  exclude?: FingerprintField[]
}
```

## License

ISC

---
_Source: https://npm.io/package/server-side-fingerprint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
