Developer Docs
Everything you need to integrate device fingerprinting into your application.
Getting Started
Lightning Research identifies unique devices using 42+ browser and hardware signals — GPU rendering, WebGL capabilities, audio context, canvas fingerprinting, and more. Unlike cookie-based solutions, our identifiers persist across browsers, incognito sessions, and VPNs.
Use it for fraud prevention, account security, bot detection, and device analytics. The SDK collects signals client-side and sends them to our API, which returns a stable device ID with confidence score and risk assessment.
Installation
Install the SDK via your preferred package manager.
Authentication
All API requests require an API key passed via the X-API-Key header. You can find your API key in the dashboard under Settings.
curl -X POST https://api.lrdefender.lightningresearch.ai/api/device-id \
-H "Content-Type: application/json" \
-H "X-API-Key: lr_live_your_api_key_here" \
-d '{"userAgent":"...","screenWidth":1920}'Keep your API key secret
Never expose your API key in client-side code. Use the SDK on the client and verify on your backend with the API key.
Quick Start
Get device fingerprinting running in under 5 minutes.
Client-Side — Initialize and Identify
import { LightningResearch } from '@lightningresearch/sdk'
const lr = new LightningResearch({
apiKey: 'lr_live_...',
endpoint: 'https://api.lrdefender.lightningresearch.ai',
})
const result = await lr.identify()
console.log(result.deviceId) // "d_8f3k..."
console.log(result.confidence) // 0.995
console.log(result.riskScore) // "low"Server-Side — Verify the Fingerprint
const response = await fetch(
'https://api.lrdefender.lightningresearch.ai/api/device-id',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.LR_API_KEY,
},
body: JSON.stringify({ fingerprint: clientFingerprint }),
}
)
const { deviceId, confidence, risk } = await response.json()API Reference
Base URL: https://api.lrdefender.lightningresearch.ai (or http://localhost:3000 for local development).
/api/device-idSubmit browser signals and receive a device ID with confidence score, risk level, and match metadata.
/api/device/:idRetrieve device details including fingerprint history, visit count, and associated risk data.
/api/analyticsAggregated analytics: device counts, browser distributions, screen resolutions, and behavioral data.
/api/security-analysisThreat intelligence: risk distributions, flagged devices, and detection breakdown.
/api/realtime-monitoringReal-time metrics: active sessions, request volume, and average response times.
/api/compliance/consentRecord user consent for privacy compliance tracking.
Rate Limits: Defaults are deployment-configurable (commonly 100 req/min per API key). Rate limit headers (X-RateLimit-Remaining) are included when enabled.
Error Codes
All errors return a JSON body with error and message fields.
Webhooks
Receive HMAC-signed notifications when important events occur. Configure webhook URLs in your dashboard.
device.newdevice.risk_changedevice.suspicioussession.anomalyapp.post('/webhooks/fingerprint', (req, res) => {
const signature = req.headers['x-signature']
const isValid = verifyHmac(signature, req.body, webhookSecret)
if (!isValid) return res.status(401).end()
const { event, data } = req.body
switch (event) {
case 'device.suspicious':
alertSecurityTeam(data)
break
case 'device.new':
trackNewDevice(data)
break
}
res.status(200).json({ received: true })
})SDKs
Official SDKs for JavaScript, with full TypeScript support.
Zero Dependencies
12 KB gzipped, no external deps
TypeScript First
Full type definitions included
Framework Agnostic
React, Vue, Angular, vanilla JS
Privacy Compliant
GDPR consent mode support
const lr = new LightningResearch({
apiKey: 'lr_live_...',
endpoint: 'https://api.lrdefender.lightningresearch.ai',
timeout: 5000,
signals: {
canvas: true,
webgl: true,
audio: true,
fonts: true,
},
privacy: {
respectDoNotTrack: true,
consentRequired: false,
},
})Ready to integrate?
Try the live demo to see fingerprinting in action, then follow the quick start guide.