Documentation

FraudSense Developer Docs

Real-time device intelligence and fraud scoring for banks and fintechs. 44 signals, 4 combined patterns, plain English reasons. Integrate in 10 minutes.

What is FraudSense?

FraudSense is a device intelligence SDK and API that detects fraud at the device level — before transactions are processed. It runs silently inside your React Native app, evaluates 44 signals across 8 categories, and returns a calibrated risk score with confidence labels and plain English reasons.

ComponentDescription
SDK v1.2.0React Native module — 44 signals across device, sensor, location, battery, network, security, behavior, and pattern categories
APIREST API that stores device history, enriches with server-side IP intelligence, and returns scored reports
PortalSelf-serve dashboard for API key management, usage monitoring, and client analytics

Signal categories

CategorySignalsWhat it detects
Device9Emulators, integrity failures, locale/timezone mismatches
Security3Root/jailbreak, proxy interception, emulator detection
Network5VPN, datacenter IPs, carrier country mismatch
Behavior12Bots, credential stuffing, paste attacks, superhuman speed
Sensor5No movement, no orientation change, extreme brightness
Location3GPS spoofing, low accuracy, permission denied
Battery3Always charging, no discharge cycle, device farms
Patterns4Combined automation, location hiding, credential stuffing, device farm

How it works

Flow
// 1. SDK initializes silently at app startup
// 2. 7 collectors run in background (device, sensor, location, battery, network, behavior, security)
// 3. At a transaction point, your app calls getReport()
// 4. RiskEngine evaluates 44 signals → computes score 0–100
// 5. stableScore averages last 3 reports to eliminate first-load spikes
// 6. Full report returned with confidence labels + plain English reasons

Your App → FraudSense SDK → RiskEngine → Score + Labels + Summary + Patterns

Base URL

Base URL
https://api.getfraudsense.com

SDK + API

Quick Start

Get from zero to a working risk score in under 10 minutes.

1

Get your API key

Visit the developer portal → click "Get Free API Key". Your key is generated instantly and starts with fs_live_.

ℹ️
You get 1,000 free calls per month with no credit card required.
2

Install the SDK

bash
npm install fraudsense-sdk
bash — peer dependencies
npx expo install expo-battery expo-brightness expo-crypto expo-device \
  expo-location expo-network expo-screen-orientation \
  expo-secure-store expo-sensors
3

Initialize at app startup

JavaScript
import FraudSense from 'fraudsense-sdk';

await FraudSense.init({
  apiKey:        'fs_live_xxxx',
  endpoint:      'https://api.getfraudsense.com',
  collectGPS:    true,
  trustedRegion: 'AE',  // reduces expat false positives
  debug:         false,
});
4

Score a transaction

JavaScript
// At login, payment, or withdrawal
const report = await FraudSense.getReport();

// Use stableScore after 3+ reports (recommended)
const level = report.risk.isStable
  ? report.risk.stableLevel
  : report.risk.level;

if (level === 'CRITICAL') blockTransaction();
if (level === 'HIGH')     requireVerification();
if (level === 'MEDIUM')   requestOTP();
if (level === 'LOW')      allowTransaction();

// Plain English summary for your fraud team
console.log(report.risk.summary);

API

Authentication

FraudSense uses two authentication methods depending on the caller.

API Key — SDK and server-to-server calls

Pass your API key in the x-api-key header for all risk scoring and event endpoints.

HTTP Header
x-api-key: fs_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

JWT Token — dashboard and management

Use a Bearer token in the Authorization header for account management endpoints.

HTTP Header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Get a JWT token

curl -X POST https://api.getfraudsense.com/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"you@company.com","password":"yourpassword"}'

SDK

SDK Installation

Requirements

RequirementVersion
React Native0.73+
Expo SDK54+
Node.jsv20+
iOS15+
AndroidAPI 21+

Install via npm

bash
npm install fraudsense-sdk

Install peer dependencies

bash
npx expo install expo-battery expo-brightness expo-crypto expo-device \
  expo-location expo-network expo-screen-orientation \
  expo-secure-store expo-sensors

Add permissions (iOS) — app.json

json
{
  "expo": {
    "plugins": [
      ["expo-location", {
        "locationWhenInUsePermission": "Used to verify transaction safety."
      }]
    ]
  }
}

SDK

Initialization

Call FraudSense.init() once at app startup — ideally on the splash screen before navigating to login.

JavaScript
import FraudSense from 'fraudsense-sdk';

await FraudSense.init({
  apiKey:        'fs_live_xxxx',                      // Required
  endpoint:      'https://api.getfraudsense.com',       // Required
  collectGPS:    true,                                 // Optional — default false
  trustedRegion: 'AE',                                 // Optional — ISO country code
  autoFlush:     true,                                 // Optional — default true
  flushInterval: 30000,                               // Optional — ms, default 30s
  debug:         false,                               // Optional — console logs
});

Configuration options

OptionTypeDefaultDescription
apiKeystringYour FraudSense API key. Required.
endpointstringAPI base URL. Required.
collectGPSbooleanfalseRequest location permission and collect GPS for spoofing detection.
trustedRegionstringISO country code (e.g. "AE"). Reduces false positives for expat-heavy markets where locale and timezone commonly mismatch.
autoFlushbooleantrueAutomatically send reports to backend on interval.
flushIntervalnumber30000Milliseconds between automatic flushes.
debugbooleanfalsePrint SDK logs to console. Disable in production.

SDK

Behavior Hooks

Wire up these hooks in your components to collect behavioral signals. The more hooks you add, the more accurate the interactionScore becomes.

Tap recording

JSX
import BehaviorCollector from 'fraudsense-sdk/collectors/BehaviorCollector';

<TouchableOpacity
  onPress={(e) => {
    BehaviorCollector.recordTap(e.nativeEvent.locationX, e.nativeEvent.locationY);
    handleAction();
  }}
/>

Text change / paste detection

Paste detection works automatically via text length jump analysis — no onPaste prop needed.

JSX
<TextInput
  onChangeText={(text) => {
    BehaviorCollector.recordTextChange('email', text); // auto-detects paste
    setEmail(text);
  }}
/>

<TextInput
  onChangeText={(text) => {
    BehaviorCollector.recordTextChange('password', text);
    setPassword(text);
  }}
/>

Scroll recording

JSX
<ScrollView
  onScroll={(e) => BehaviorCollector.recordScroll(e.nativeEvent.contentOffset.y)}
  scrollEventThrottle={16}
>

Screen transition recording

JavaScript
useEffect(() => {
  BehaviorCollector.recordScreenTransition('PaymentScreen');
}, []);
💡
At minimum, add recordTextChange on login fields and recordTap on the submit button. This alone captures credential stuffing and bot patterns reliably.

SDK

SDK Methods

getReport()

Returns a full risk report for the current session. Use risk.stableScore and risk.stableLevel after 3+ reports for more accurate scoring.

JavaScript
const report = await FraudSense.getReport();

console.log(report.risk.stableScore);   // 0–100, averaged over last 3
console.log(report.risk.stableLevel);   // LOW / MEDIUM / HIGH / CRITICAL
console.log(report.risk.isStable);      // true after 3+ reports
console.log(report.risk.summary);       // plain English verdict
console.log(report.risk.triggered);     // array of fired signals with reasons
console.log(report.risk.patternsDetected); // number of combined patterns fired

getRiskScore()

Returns just the score and level. Lighter than getReport() if you only need the number.

JavaScript
const { score, level, triggered } = await FraudSense.getRiskScore();

getDeviceId()

Returns the stable SHA-256 device fingerprint. Persists via secure storage across sessions.

JavaScript
const deviceId = FraudSense.getDeviceId();
// Returns: "fs_a3f9b2c1d4e5..."

Other methods

MethodDescription
FraudSense.flush()Force-send pending report to backend immediately
FraudSense.pause()Pause all collectors (e.g. when app goes to background)
FraudSense.resume()Resume collectors after pause
FraudSense.reset()Clear all local data, session state, and score history

SDK

Event Hooks

Subscribe to real-time events from the SDK using FraudSense.on(). Returns an unsubscribe function.

JavaScript
// Fires when SDK is initialized
FraudSense.on('ready', ({ deviceId, version }) => {
  console.log('SDK ready', deviceId);
});

// Fires after every getReport() call
FraudSense.on('report', (report) => {
  setRiskBadge(report.risk.stableLevel);
});

// Fires after every flush attempt
FraudSense.on('flush', ({ success, response }) => {
  if (!success) console.warn('Flush failed');
});

// Unsubscribe when component unmounts
const unsub = FraudSense.on('report', handler);
return () => unsub();

API

Auth Endpoints

POST
/v1/auth/register
Create a new client account. Returns JWT token + first API key.
POST
/v1/auth/login
Login with email and password. Returns JWT token.
GET
/v1/auth/me
Get current client profile. Requires Bearer token.

Register

{
  "email":       "you@company.com",
  "password":    "SecurePass1!",
  "companyName": "Acme Bank"
}

API

Events Endpoint

The SDK automatically posts to this endpoint on every flush. You can also call it directly for server-side integrations.

POST
/v1/events/batch
Submit a device report batch. Called automatically by the SDK every 30 seconds.
ℹ️
Requires x-api-key header. When using the SDK, this endpoint is called automatically — you do not need to call it directly.

Request body

JSON
{
  "deviceId":    "fs_a3f9b2c1...",
  "sessionId":   "1744123456789",
  "deviceProfile": {
    "model":      "iPhone 17 Pro Max",
    "os":         "iOS",
    "timezone":   "Asia/Dubai",
    "locale":     "en-US",
    "isEmulator": false,
    "isRooted":   false
  },
  "events": [{
    "type":             "RISK_REPORT",
    "riskScore":        17,
    "riskLevel":        "LOW",
    "triggeredSignals": [],
    "fingerprint":      "fs_xyz...",
    "sdkVersion":       "1.2.0",
    "timestamp":        1744123456789
  }]
}

API

Device History

GET
/v1/risk/history/:deviceId
Returns the last 50 sessions and a history summary for a device.
cURL
curl https://api.getfraudsense.com/v1/risk/history/fs_abc123 \
  -H "x-api-key: fs_live_xxxx"

API

API Keys

GET
/v1/keys
List all API keys for your account. Requires Bearer token.
POST
/v1/keys
Generate a new API key. Body: {"name":"Production Key"}
DELETE
/v1/keys/:id
Revoke an API key by ID.

API

Dashboard

GET
/v1/dashboard/stats
Usage stats — total calls, calls this month, free calls remaining, estimated bill.
GET
/v1/dashboard/devices
List all devices seen by your account (last 50).

Reference

Risk Signal Catalogue

FraudSense v1.2.0 evaluates 44 signals per session across 8 categories. Each signal includes a confidence rating and plain English reason returned in the report.

ℹ️
Confidence levels: HIGH — almost never a false positive. MEDIUM — reliable but context-dependent. LOW — mild signal, contributes to score but not conclusive alone.

Device signals (9)

SignalConfidencePointsReason
missing_device_nameMEDIUM+8Device model name could not be read. Common on emulators or modified devices.
outdated_osMEDIUM+6Device running iOS < 15 or Android < 10. Older OS is more vulnerable to exploits.
not_real_deviceHIGH+20Device is not a physical device. Strongly indicates an emulator or simulator.
device_integrity_failHIGHvariableHardware profile failed integrity checks. Model and OS combination appears inconsistent.
resolution_anomalyMEDIUM+12Screen resolution does not match expected values for the reported device model.
font_scale_anomalyMEDIUM+8Font scale is set to an unusual value. Automated tools often use non-standard display settings.
default_font_scaleLOW+2Font scale at factory default 1.0. Most real users adjust this over time.
locale_timezone_mismatchLOW+2–5Device language does not match timezone. Common among expats but also seen on spoofed devices. Reduced to +2 when trustedRegion is set.
region_ip_mismatchMEDIUM+3–10Device region setting does not match IP address country. May indicate VPN or location spoofing. Reduced to +3 when IP matches trustedRegion.

Security signals (3)

SignalConfidencePointsReason
emulator_detectedHIGH+15–25Device shows strong signs of being an emulator or simulator. Score scales with confidence level.
rooted_or_jailbrokenHIGH+25Device appears to be rooted or jailbroken. Security controls may be bypassed.
proxy_activeHIGH+15HTTP proxy is active on this device. Traffic may be intercepted or manipulated.

Network signals (5)

SignalConfidencePointsReason
vpn_detectedMEDIUM+8–20VPN or proxy network detected. Score scales with confidence (0–1). Legitimate users use VPNs too.
carrier_country_mismatchHIGH+10SIM card country does not match IP address country. Strong indicator of VPN or location spoofing.
datacenter_ipHIGH+12Request is coming from a datacenter or cloud server IP. Indicates automated or server-side activity.
ip_lookup_blockedLOW+3IP geolocation lookup failed while connected. May indicate network filtering or proxy.
no_connectionLOW+3Device has no internet connection. Score may be incomplete.

Behavior signals (12)

SignalConfidencePointsReason
bot_like_behaviorHIGH+25Interaction patterns highly consistent with automated bot activity. interactionScore < 20.
suspicious_behaviorMEDIUM+12Interaction patterns show some signs of automated behavior. interactionScore 20–40.
human_behavior_confirmedMEDIUM-5Trust signal. Interaction patterns consistent with a real human. interactionScore >= 70.
superhuman_tap_speedHIGH+15Taps occurring faster than humanly possible (< 100ms apart). Strong indicator of automated input.
low_tap_entropyMEDIUM+10All taps hitting the same screen location. Bots typically tap the exact same pixel.
screen_transition_too_fastHIGH+15Screens changing faster than a human can read them (< 500ms per screen). Indicates scripted navigation.
session_too_shortMEDIUM+10Entire session completed in under 5 seconds. Too fast for normal human interaction.
paste_on_login_fieldsMEDIUM+15Email or password was pasted rather than typed. Common pattern in credential stuffing attacks.
multi_field_pasteMEDIUM+10Multiple fields filled via paste. Automated tools often paste pre-filled credentials.
paste_on_payment_fieldLOW+8Payment amount or note was pasted. Could be normal behaviour or automated transaction.
excessive_pasteMEDIUM+10Unusually high number of paste events detected (3+) across the session.
default_font_scale_on_emulatorHIGH+5Default font scale combined with emulator signals. Consistent with automated test environments.

Sensor signals (5)

SignalConfidencePointsReason
no_accelerometer_dataHIGH+10No accelerometer data collected. Real devices always have motion sensors active.
zero_device_movementMEDIUM+8Device showed no physical movement. Bots and emulators typically show zero motion.
minimal_device_movementLOW+4Very low physical movement detected. Device may be stationary or automated.
no_orientation_changeLOW+5Screen was never rotated during the session. Could indicate automated or scripted usage.
extreme_brightnessLOW+5Screen brightness locked at 0% or 100%. Automated tools often ignore display settings.

Location signals (3)

SignalConfidencePointsReason
location_deniedLOW+5Location permission was denied. Reduces available trust signals.
low_location_accuracyLOW+5GPS accuracy is very low (> 500m). Could indicate indoor use or spoofing.
gps_spoofing_detectedHIGH+25Device moved at an impossible speed between GPS readings (> 900 km/h). Strong GPS spoofing indicator.

Battery signals (3)

SignalConfidencePointsReason
critically_low_batteryLOW+4Battery below 5%. Unusual for a device actively making transactions.
always_chargingMEDIUM+8Device is always plugged in. Common in device farms running automated scripts.
no_battery_cycleMEDIUM+5No charge/discharge cycle detected after 20+ readings. Device may be permanently connected to power.

Reference

Combined Pattern Detection

Beyond individual signals, FraudSense detects 4 combined attack patterns. Patterns fire when multiple correlated signals appear together — they carry extra weight because combinations are far more reliable than single signals.

PatternConfidencePointsTriggers when
automation_pattern HIGH +10 2+ of: zero_device_movement, minimal_device_movement, session_too_short, no_accelerometer_data
location_hiding_pattern HIGH +12 2+ of: vpn_detected, locale_timezone_mismatch, region_ip_mismatch, carrier_country_mismatch
credential_stuffing_pattern HIGH +15 2+ of: paste_on_login_fields, multi_field_paste, bot_like_behavior, suspicious_behavior
device_farm_pattern MEDIUM +12 2+ of: always_charging, no_battery_cycle, zero_device_movement, no_orientation_change
💡
A device that triggers credential_stuffing_pattern should always result in at least a step-up authentication challenge regardless of the total score. The pattern alone is a strong fraud indicator.

Reference

Risk Labels

High-level labels explain why a device scored HIGH — more actionable than a raw score alone. Returned in risk.byCategory and the risk.summary field.

CategorySignals involvedRecommended action
Fake deviceemulator_detected, not_real_device, device_integrity_failBlock immediately
Tampered devicerooted_or_jailbroken, proxy_activeBlock or require biometric
Location spoofinggps_spoofing_detected, location_hiding_patternBlock on payment/withdrawal
Device farmdevice_farm_pattern, always_charging, no_battery_cycleFlag account for review
Bot behaviorbot_like_behavior, automation_pattern, superhuman_tap_speedRequire CAPTCHA or OTP
Credential stuffingcredential_stuffing_pattern, paste_on_login_fieldsForce password reset
Suspicious networkvpn_detected, datacenter_ip, carrier_country_mismatchStep-up on financial actions
Identity mismatchlocale_timezone_mismatch, region_ip_mismatchMonitor — low confidence alone

Reference

Response Format

Risk levels

ScoreLevelRecommendation
0 – 24LOWAllow — proceed normally
25 – 49MEDIUMStep-up — request OTP or biometric
50 – 74HIGHBlock — require manual review
75 – 100CRITICALBlock and flag — escalate immediately

Risk object schema (v1.2.0)

FieldTypeDescription
scoreintegerRaw composite risk score 0–100
levelstringLOW / MEDIUM / HIGH / CRITICAL based on raw score
stableScoreintegerAverage of last 3 scores — smooths first-load spikes
stableLevelstringLevel based on stableScore — use this for decisions
isStablebooleanTrue after 3+ reports have been generated
summarystringPlain English verdict for fraud teams
triggeredarrayAll fired signals with signal name, points, confidence, and reason
byCategoryobjectTriggered signals grouped by category
signalCountintegerTotal number of signals that fired
highConfidenceSignalsintegerNumber of HIGH confidence signals that fired
patternsDetectedintegerNumber of combined patterns that fired
versionstringRiskEngine version used for scoring

Triggered signal object

FieldTypeDescription
signalstringSignal identifier e.g. "paste_on_login_fields"
pointsintegerPoints added to score (negative = trust signal)
categorystringdevice / sensor / location / battery / network / security / behavior / pattern
confidencestringHIGH / MEDIUM / LOW
reasonstringPlain English explanation for fraud teams
detailstringOptional technical detail e.g. "locale:en-US tz:Asia/Dubai"

Reference

IP Intelligence

Collected automatically via ipapi.co on every session. No extra configuration needed.

FieldTypeDescription
ipstringClient IP address
ipCountrystringISO country code (e.g. AE, SA)
ipCitystringCity name
ipOrgstringISP or organization name
ipIsDatacenterbooleanTrue if IP belongs to a cloud/datacenter provider
isVPNbooleanTrue if VPN confidence >= 0.35
vpnConfidencenumber0.0–1.0 VPN likelihood score
carrierCountryMismatchbooleanTrue if SIM country differs from IP country

Reference

Device History

Every device that calls the API gets a persistent history record. Accessible via /v1/risk/history/:deviceId.

FieldTypeDescription
totalSessionsintegerTotal number of sessions for this device
highRiskCountintegerSessions scored HIGH or CRITICAL
firstSeenAtstringWhen this device was first seen
lastSeenAtstringMost recent session timestamp
isNewDevicebooleanTrue if this is the first session for this device

API

Status Codes

CodeMeaningAction
200SuccessProcess the response normally
400Bad requestCheck required fields — deviceId and sessionId are always required
401UnauthorizedCheck your API key — must be in x-api-key header
403ForbiddenAccount suspended — contact support
404Not foundCheck the endpoint URL
429Rate limitedSlow down requests — max 1,000/15 min
500Server errorRetry after a short delay

Reference

Changelog

SDK v1.2.0 — April 2026

  • Signal count expanded from 18 to 44 signals across 8 categories
  • Added SecurityCollector — emulator detection with confidence score, root/jailbreak heuristics, proxy detection
  • Added 4 combined pattern detectors — automation, location hiding, credential stuffing, device farm
  • Added confidence labels (HIGH/MEDIUM/LOW) and plain English reasons per signal
  • Added stableScore — averages last 3 reports to eliminate first-load spikes
  • Added trustedRegion config — reduces expat false positives for UAE and MENA markets
  • Added summary field — plain English verdict for fraud teams
  • Added byCategory — signals grouped by category for easier client integration
  • Added paste detection via text length jump analysis (no onPaste prop required)
  • Added device integrity scoring — model vs OS cross-validation
  • Added locale vs timezone mismatch signal
  • Added region vs IP country mismatch signal
  • Improved VPN detection — confidence score 0–1 instead of boolean, cross-checks carrier country vs IP country
  • Improved NetworkCollector — live IP intelligence via ipapi.co (country, city, org, datacenter flag)
  • Fixed battery level comparison (was checking 0–1 float, now correctly checks 0–100 integer)
  • Fixed all collector export issues — added collect() method to SensorCollector, BatteryCollector, LocationCollector
  • Fixed locale/timezone collection via getLocales()/getCalendars() for newer Expo versions

SDK v1.1.0 — April 2026

  • Initial public release on npm as fraudsense-sdk
  • 6 collectors: Device, Sensor, Location, Battery, Network, Behavior
  • 18 signals in RiskEngine
  • SHA-256 device fingerprinting via expo-secure-store
  • Singleton pattern throughout SDK

API v1.0.0 — March 2026

  • Initial launch at api.getfraudsense.com
  • JWT authentication, email verification, API key management
  • Free tier — 1,000 calls/month
  • Admin panel with suspend/activate/email/usage controls
  • AI chatbot (Claude Haiku) for developer support
  • /demo interactive fraud scenarios
  • Railway deployment with PostgreSQL and Prisma

Support

Support

💬
We respond within 24 hours on business days. For enterprise clients, dedicated support is included.

Contact

Email: support@getfraudsense.com

GitHub Issues: github.com/getfraudsense/fraudsense-api

Before reaching out

  • Check the Status Codes section for common errors
  • Verify your API key is active in the developer portal
  • Make sure deviceId and sessionId are included in every request
  • For SDK issues, enable debug: true and check console logs
  • Use the AI chatbot on the portal for instant answers