Flow
1
Mint a monitoring credential
Your backend calls
POST /v3/events/sdk-token/ with your API key and the user’s vendor_data.2
Submit from the device
The app posts to
POST /v1/events/ (or POST /v1/events/batch/) with the X-Monitoring-Token header.3
Rules run as usual
The event is enriched, rolled up and evaluated by exactly the same rules as a server-submitted one.
Minting a credential
Minting requires event ingestion to be switched on for the application. While it is off, this endpoint answers
403 with {"code": "event_monitoring_disabled"} rather than handing out a credential that could never write.Submitting
What the server enforces
- Subject binding. The credential is scoped to one
vendor_dataat mint time. Asubjectblock in the request body is overwritten, so a tampered client cannot write to another user’s timeline. - Network context. The IP address, user agent, accept-language and origin are derived from the request, and those server-derived values win over any client hint for rule evaluation. Rule evidence records the difference as a field source.
- Automation score. Didit decides
device_context.bot_scoreon the server, on a 0 to 100 scale, the oneevent.device.bot_scorerules compare. It reads the request itself: a user agent that names an automation tool, such as a headless browser or a browser driver, scores 100. It also reads the device evidence newer Didit SDK versions send with every batch: what the SDK read on the device, not a score (on the web, signs that an automation tool drives the browser, and, on a page that collects the full device fingerprint, that it renders in software; in an app, a hooking framework, an emulator or simulator, a debugger, or a rooted or jailbroken device). Didit decides what that evidence is worth, so the score does not depend on a number the device computed about itself. Older SDK versions report their own score instead, on a 0 to 1 scale in theX-Didit-FP-Bot-Scoreheader and the batch’sfingerprint_v2.bot.score(0.9 becomes 90). Nothing a device sends can lower the score: its evidence and its own score can only raise it. Abot_scorethe page or app posts indevice_contextdoes not set the score: it is kept asdevice_context.metadata.client_bot_score. Abot_scorein the event’spayloadstays in the payload, whereevent.bot.*rules read it. When Didit has nothing to go on (no evidence it can read, no score from the SDK, nothing in the request), the event has no bot score, not 0. To report your own bot detection as the device score, submit the event from your backend withPOST /v3/events/. - Category scope. A credential scoped to
sessioncannot submit apaymentevent; it is rejected with400. - Use budget. A batch spends one use per event, so a 500-event batch cannot slip past a 10-use credential as a single use.
- Origin binding. When
bind_to_originis set, a request whoseOrigindoes not match is refused - including one with noOriginat all.
Batching
What to drop under backpressure
If you have to shed events, shed the cheap ones. These are safe to drop:session.page_view · session.sdk_heartbeat · session.sdk_loaded · session.device_seen · session.bot_signal_observed · bonus.promotion_viewed · affiliate.referral_clicked
These are not - flush them first:
every security, payment, dispute and responsible_gambling event, plus gameplay.bet_placed, gameplay.bet_settled and gameplay.p2p_settlement.
The list endpoints return the same classification per event as is_droppable, so a client can be driven by it rather than by a hardcoded copy.
Web SDK
@didit-protocol/signals is the browser client of this lane: it queues, batches, retries and attaches the device fingerprint for you.
Automation evidence
From version 0.3.0, the package also sends what it read about how the page is driven, such as signs that an automation tool drives the browser. There is nothing to turn on. The page sends those facts and no score: Didit decides the automation score on its servers. The facts are read by a second file of the package (about 13.7 KB gzipped), which is loaded the first time something is sent, so the part your page loads up front stays under 6 KB. A bundler emits it as a chunk of its own and nothing changes in your code. To read them, it reads no canvas, no audio, no fonts and no graphics of the device, and it stores nothing. A request waits for it for at most 2 seconds, and otherwise goes out without them.Full device fingerprint
Where the device ID is kept
The stored device ID lives inlocalStorage and in a cookie, with or without the full fingerprint.
An ID your visitor cleared is gone: the device is new on the next page.
Upgrading from version 0.2
Remove the@didit-protocol/signals/device import and the enableDeviceIntelligence() call: that entry no longer exists.
To keep sending the full fingerprint, call configureDevice({ fullFingerprint: true }) in its place.
Version 0.2 also kept the device ID in IndexedDB and Cache storage once enableDeviceIntelligence() was called.
From version 0.3.0 the ID is kept in localStorage and a cookie only.
In version 0.2 the full fingerprint is turned on like this:
Automatic capture
One optional entry of the same package adds to it, from version 0.2.0.
Every event carries
session.session_id and a sequence number, so a user’s path through your site reads in order on their timeline.
The telemetry of session.bot_signal_observed is what event rules read as event.bot.*: a script’s timing_variance_ms is close to 0, and a script that dispatches its own clicks shows up in untrusted_actions.
Automatic capture never reads the value of a field, which keys are pressed, the text of the page, element IDs, query strings or URL fragments.
It reports a page by its path, with every segment that looks like an identifier replaced by :id: /users/48213/orders is sent as /users/:id/orders.
A credential belongs to one user, so nothing is sent before your backend knows who is there.
What happens before that, such as a visit to the forgotten-password page followed by a sign-in, is kept in memory (25 events by default) and sent with the first credential, marked pre_auth: true.
An action of somebody who never signs in goes through your backend, on the server lane.
Read the device in the browser with getDeviceContext() from this entry, send it to your backend with the action, and have your backend put it in the event’s device_context, so the event meets the same device as the ones sent from the browser.
max_uses.
Native apps
DiditSignals, part of the iOS and Android SDKs, is the same client for an app: submitEvent with a monitoring token, a batched queue, and the device fingerprint on every batch.
From version 4.15.0 of the iOS and Android SDKs, automatic capture works as on the web, with the same events and the same payload keys, so one set of event rules covers your site and your app.
startAutocapture early, for example in Application.onCreate().
If your app initializes the SDK later, when a screen is already shown, pass that activity so the session starts on it: DiditSignals.startAutocapture(options, activity = this).
iOS finds the app’s windows by itself.
An app does not send two of the web’s payload fields:
untrusted_actions and the payload’s bot_score.
Its automation score still reaches your rules as event.device.bot_score: Didit decides it from what the SDK sends with every batch, as described under Automation score above.
Automatic capture in an app never reads what is typed, which keys are pressed, the text or labels of views, view identifiers or coordinates.
It keeps the time of each touch and the direction of each move, and sends counts and timing only.
Header compatibility
The canonical header isX-Monitoring-Token. X-Transaction-Token is accepted as a temporary alias so an app that already holds a transaction credential path can migrate incrementally.
Choosing a lane
Both produce identical event records and run identical rules. Use the server lane whenever no end user is present.
Next
Event ingestion
The envelope, categories, retention and idempotency.
Rules on events
Velocity, ratio, sequence and correlation rules.