Skip to content
Interactive Playground

Build with LRDefender in 3 minutes

See your device fingerprint live, then follow the steps below to integrate it into your own app.

Your Device — Right Now

Hardware probe

Integrate into Your App

Follow these steps to add device fingerprinting to your own React app. The entire integration takes under 3 minutes.

1

Create a React App

Skip if you already have one

bash
$ npx create-react-app my-app --template typescript
$ cd my-app
2

Install the SDK

npm, yarn, or pnpm — pick your favorite

bash
$ npm install @lightningresearch/sdk

Or use CDN (no build step):

index.html
<script src="https://lrdefender.lightningresearch.ai/sdk/v1/lr.min.js"></script>
3

Initialize the SDK

Import and create a client instance

src/App.tsx
import { LightningResearch } from '@lightningresearch/sdk'

const client = new LightningResearch({
  apiKey: 'YOUR_API_KEY',   // Get one free at /register
  region: 'auto',            // 'us' | 'eu' | 'auto'
})

CDN version: After loading the script, access via window.LightningResearchSDK.LightningResearch

4

Identify a Device

One call gets you a stable device ID + risk score

src/App.tsx
async function identifyDevice() {
  const result = await client.identify({
    tag: 'login-page',       // optional — helps you filter in dashboard
    linkedId: 'user-123',    // optional — link to your user ID
  })

  console.log(result.deviceId)     // "fp_9k2x...mR4"
  console.log(result.confidence)   // 0.995
  console.log(result.risk.level)   // "low"
  console.log(result.risk.score)   // 0.02
  console.log(result.isNewDevice)  // true | false
  console.log(result.visitCount)   // 1
}
5

Complete Example

Copy-paste this into your React app and run it

src/App.tsx
import { useEffect, useState } from 'react'
import { LightningResearch } from '@lightningresearch/sdk'

const client = new LightningResearch({
  apiKey: 'YOUR_API_KEY',
})

export default function App() {
  const [device, setDevice] = useState(null)

  useEffect(() => {
    client.identify().then(setDevice)
  }, [])

  if (!device) return <p>Scanning device...</p>

  return (
    <div>
      <h1>Device ID: {device.deviceId}</h1>
      <p>Confidence: {(device.confidence * 100).toFixed(1)}%</p>
      <p>Risk: {device.risk.level} ({device.risk.score})</p>
      <p>New device: {device.isNewDevice ? 'Yes' : 'No'}</p>
      <p>Visit count: {device.visitCount}</p>
    </div>
  )
}

What happens next: The SDK collects 90+ hardware and software signals, sends them to the LRDefender API, and returns a stable device ID with risk scoring. You can see all events in your dashboard.

More API Features

Bot Detection

typescript
const bot = await client.bot.detect()
// { is_bot: false, bot_score: 0.02,
//   human_confidence: 0.98 }

Network Intelligence

typescript
const net = await client.network.analyze()
// { is_vpn: true, provider: "NordVPN",
//   risk_score: 0.82 }

Behavioral Tracking

typescript
client.startBehavioralTracking()
// Tracks mouse, keyboard, scroll patterns
// Detects bots via behavioral analysis

Threat Intelligence

typescript
const threat = await client.threat.assess(ip)
// { risk_score: 0.12, level: "low",
//   recommendation: "allow" }

Ready to protect your app? Get 10,000 free identifications per month.