Skip to content

Client-Side Risk Scoring ​

Single API call for client-side risk assessment. Instead of manually combining neoprint.detectBot(), neoprint.detectSpoofing(), neoprint.detectAntiDetect(), and hardware validation, neoprint.attestDevice() does it all with a weighted scoring system. This is a heuristic — for production security, combine with neoprint.serverHints().

Usage ​

ts
const fp = await neoprint.get()

const proof = await neoprint.attestDevice(fp, {
  strictness: 'medium',
  challenge: 'server-nonce-abc',
})

if (proof.score > 0.8) {
  // Trusted request
}

Result ​

ts
interface AttestResult {
  score: number          // 0-1 weighted trust score
  isHuman: boolean       // no bot signals
  isPhysical: boolean    // no VM or emulator
  isAuthentic: boolean   // no spoofing or anti-detect
  factors: string[]      // checks that passed
  risks: string[]        // checks that failed
  integrityToken: string // tamper-evident token for server
}

Strictness Levels ​

LevelChecks runUse case
lowBot, spoofing, GPU, canvas, audio, fonts, platform consistency, webdriver, languages, screenFast pass, login forms
mediumAll of low + VM detection, hardware perf benchmarks, entropy thresholdDefault, payments, account creation
highAll of medium + confidence threshold, ad blocker checkHigh-security, fintech, fraud prevention

Weighted Factors ​

Not all signals are equal. The scoring system weights them by how hard they are to fake:

CategoryWeightExamples
HardwareHigh (10-15)Real GPU (not SwiftShader), realistic hardware perf, audio context, canvas rendering
ConsistencyMedium (8-12)No spoofing, no bot, no anti-detect, not a VM, consistent platform/UA
Soft signalsLow (2-5)Webdriver off, has languages, reasonable screen, sufficient entropy

Integrity Token ​

The integrityToken is a base64-encoded, signed payload that prevents casual tampering in the browser console. Send it to your server for verification:

ts
// Client
const proof = await neoprint.attestDevice(fp, {
  challenge: serverNonce,
})
await fetch('/api/verify', {
  method: 'POST',
  body: JSON.stringify({ token: proof.integrityToken }),
})

// Server
const { valid, payload } = neoprint.verifyIntegrityToken(token)
if (!valid) return res.status(403).json({ error: 'invalid token' })
if (payload.ch !== serverNonce) return res.status(403).json({ error: 'replay' })
if (Date.now() - payload.ts > 30000) return res.status(403).json({ error: 'expired' })
if (payload.sc < 0.7) return res.status(403).json({ error: 'low trust' })

Comparison with Platform APIs ​

Apple App AttestGoogle Play Integrityneoprint attestDevice
PlatformiOS onlyAndroid onlyAny browser
Open sourceNoNoYes
Requires appYesYesNo
Server componentApple serversGoogle serversYour own server
CostFree (Apple ecosystem)Free (Google ecosystem)Free

Released under the MIT License.