Identify the device
An IP address is weak evidence of who someone is: it is shared, and it changes. Flit's SDKs collect enough about a browser or a phone to recognise it again, and give you a token to send with the event.
How it works
- Your page or app collects
One call to the SDK, just before the login, reset or payout. It returns a visit token.
- It sends the token to your server
With the request it was already making.
- Your server passes it to Flit
As
visit_tokenon the event. A token lasts 30 minutes and only works for your application.
The key the SDK takes is your application's public one, collect_key in the answer to signing up. It is safe to ship in a page or an app; it authorises nothing.
In a browser
npm install @agentflit/browser
import { collect } from "@agentflit/browser";
const { visitToken } = await collect({ key: "flit_pk_…" });
With no build step, import it from a CDN instead, with the version pinned: https://cdn.jsdelivr.net/npm/@agentflit/[email protected]/src/index.js.
In an iOS app
A Swift package with no dependencies, for iOS 13 and later. In Xcode, choose File, then Add Package Dependencies, and enter:
https://github.com/Fraud-killer/flit-ios
import Flit
func visitToken() async -> String? {
try? await Flit.collect(key: "flit_pk_…").token
}
Flit's name for the device is kept in the Keychain, so a phone is recognised after your app is deleted and installed again.
In an Android app
A Kotlin library with no run-time dependencies, for Android 5 and later. It is built from its repository by JitPack, so add JitPack to the repositories in settings.gradle.kts, and the library to your app:
// settings.gradle.kts, inside dependencyResolutionManagement { repositories { … } }
maven("https://jitpack.io")
// your app's build.gradle.kts
dependencies {
implementation("com.github.Fraud-killer:flit-android:0.1.0")
}
It makes a network request, so call it off the main thread.
suspend fun visitToken(context: Context): String? = withContext(Dispatchers.IO) {
try { Flit.collect(context, "flit_pk_…").token } catch (e: FlitException) { null }
}
What your server sends for an app
The same event as always, with the token. Keep sending the user_agent your server received:
{ "id": "login_1001", "client_id": "user_42", "action": "login",
"ip_address": "…",
"user_agent": "okhttp/4.12.0",
"visit_token": "…" }
An app's user agent is its networking library's, okhttp/4.12.0 or MyBank/3.1 CFNetwork/…, and a script uses the same libraries. Without a token Flit reads such a login as scripted and reports automated_credential_action. The token from the app's SDK is what tells Flit it is your app.
What you gain
- The
identitypart of the answer gains adevicerung, andcoveragerises. - Findings about one origin follow the device instead of the address, so an attacker changing address is still one origin.
new_login_devicecan be reported: somewhere new.- From a browser, Flit reports one that contradicts itself:
automation_markers,platform_mismatch,spoofed_timezone. - From an app, what the SDK noticed about the phone:
jailbroken_device,emulator,hooking_framework,developer_tools,cloned_app,remote_controlwhile the screen is being captured.
What the SDKs send
Coarse values and hashes, and nothing that names the owner. None of them asks the customer for a permission.
| From | What |
|---|---|
| A browser | Hashes of how it draws (canvas, WebGL, audio, fonts), its screen, languages, time zone and platform. |
| An app | The hardware model, OS version, screen, processor count, memory, languages and time zone, and an install identifier. |
The install identifier is the platform's own (Apple's vendor identifier, Android's id) hashed together with your app's id on the phone. Flit cannot turn it back, and cannot link it to another app. The SDKs do not read the advertising identifier, contacts, photos, location or the device's name.
What a phone's own report is worth
The integrity findings are your app's observations of the phone it is running on. A rooted phone or an emulator reports itself, which is most of what you will meet. A modified copy of your app can report whatever it likes, and so can a script that calls Flit's collection endpoint directly. Flit weighs these with everything else; they are evidence, not proof.
What proves a request came from your unmodified app on a genuine device is the platform's attestation: Apple's App Attest and Google's Play Integrity. The SDKs do not use them yet.