JavaScript SDK
The Simplr JavaScript SDK collects device fingerprints and behavioral biometrics from web browsers. It's designed to be lightweight, privacy-conscious, and easy to integrate.
Features
- Device Fingerprinting - Canvas, WebGL, audio, fonts, and browser fingerprinting
- Behavioral Biometrics - Keystroke dynamics, mouse movements, scroll patterns
- Bot Detection - Headless browser and WebDriver detection
- React Integration - Hooks and components for React applications
- Real User Monitoring - Session tracking, error monitoring, performance metrics
Installation
- npm
- yarn
- pnpm
npm install @simplr-ai/js
yarn add @simplr-ai/js
pnpm add @simplr-ai/js
Quick Example
import SimplrFraud from '@simplr-ai/js';
// Initialize
const simplr = new SimplrFraud({
collectBiometrics: true,
autoStart: true
});
// Collect signals on form submit
document.querySelector('form').addEventListener('submit', async (e) => {
e.preventDefault();
const signals = await simplr.collect();
// Send to your backend
await fetch('/api/signup', {
method: 'POST',
body: JSON.stringify({
email: document.querySelector('#email').value,
signals
})
});
});
What Gets Collected
Device Signals
| Signal | Description |
|---|---|
fingerprint | Unique device hash combining multiple components |
canvas_hash | Canvas rendering fingerprint |
webgl_hash | WebGL renderer and vendor hash |
audio_hash | Audio context fingerprint |
fonts | List of detected fonts |
platform | OS and browser information |
screen | Screen resolution and color depth |
timezone | User's timezone |
language | Browser language |
Bot Detection
| Signal | Description |
|---|---|
is_headless | Headless Chrome/Firefox detected |
is_webdriver | Selenium/WebDriver detected |
canvas_blocked | Canvas fingerprinting blocked |
has_plugins | Browser plugins present |
Behavioral Signals
| Signal | Description |
|---|---|
keystroke.avg_delay | Average time between keystrokes |
keystroke.typing_speed | Characters per second |
mouse.avg_velocity | Average mouse movement speed |
mouse.straightness | How direct mouse movements are |
form_fill_time | Time to complete the form |
Bundle Sizes
| Bundle | Size (gzip) |
|---|---|
| Core SDK | ~8KB |
| + Biometrics | ~12KB |
| + React | ~15KB |
| + RUM | ~20KB |
Browser Support
| Browser | Version |
|---|---|
| Chrome | 60+ |
| Firefox | 55+ |
| Safari | 12+ |
| Edge | 79+ |
| iOS Safari | 12+ |
| Android Chrome | 60+ |
Next Steps
- Installation - Detailed installation guide
- Quick Start - Basic integration tutorial
- React Integration - React hooks and components
- RUM - Real User Monitoring setup