Core concepts
Keys, consent, screen names and the customer reference. These apply to every platform.
Keys
| Key | Where it lives | What it can do |
|---|---|---|
nb_pub_… | Inside the app or website | Writes events and requests deletion of its own installation’s data. It reads nothing, except the device’s own support conversation if you enable it, using a secret stored on that device. |
nb_sec_… | Your server only | Sends server events, and deletes a customer’s data by their reference. |
A key is shown in full only once. When you rotate it, the old one keeps working for 30 days by default for versions already in the stores. If it leaks, revoke it immediately.
Consent
consentRequiredis on by default: nothing is recorded or sent beforesetConsent(true).setConsent(false)stops collection immediately and deletes the events stored on the device.requestDataDeletion()asks to delete this user’s data. It runs within 7 days at most.- The consent notice and its wording are your app’s responsibility.
Screen names
- At most 64 characters, and
@is not allowed. - Stable names that describe the screen:
invoice_create, not an invoice number or a customer name. - Identifiers in paths are turned into
:idautomatically, but do not rely on this to hide data. - In minified builds (obfuscation / minify) class names get scrambled, so name your screens explicitly.
Customer reference
setUserRef is optional and lets you follow a specific customer. The value is 16 to 128 characters (A-Z a-z 0-9 _ -) and not digits only. No email, phone number or name.
Compute it on your server with HMAC and a secret key, because a plain hash of a user number is easy to guess:
import { createHmac } from 'node:crypto';
const userRef = createHmac('sha256', process.env.USER_REF_SECRET)
.update(String(user.id))
.digest('hex');A reference is scoped to one app, and Nabd never links two apps.
Events
| Event | Automatic? | Note |
|---|---|---|
| Rage tap | Yes | Three or more on the same spot within a second. Exclude number pads and +/- buttons. |
| Dead tap | Yes (experimental) | Flutter: only taps on a disabled button or link; record an enabled button that does nothing yourself. Web: disabled elements, and interactive elements after which nothing happens (details). |
| Code errors | Yes | Type and fingerprint only, without the message text. |
| Error message shown to the user | No | errorShown |
| Slow loading | Partly | Network adapters, or startLoading and stopLoading. |
| Task completion | No | taskCompleted. Needed to compute drop-offs and loops. |
Drop-offs and loops are computed on the server for screens you mark as a “task” in the dashboard.
Error trail
With every code error, network failure, error message or unexpected exit (on mobile), the SDK sends the user’s last 10 steps without you naming any event. It is on by default and shows in the dashboard under “Latest errors” on the screen page, and in the customer profile timeline.
| In the trail | Not in the trail |
|---|---|
| Names of screens that were opened (cleaned like all screen names) | Any text from the screen or from an input field |
| The type of element tapped: button, link, text field, toggle, tab, row, image… | The element’s name or id, or where the tap landed |
| Seconds before the error, and how many times a step repeated in a row | Elements excluded from tap detection, and the support chat |
- Collected only after consent, and cleared when consent is withdrawn, the user changes or a new session starts.
- Never sent on its own: only with error events.
- The screen page shows the last 20 errors, even without
setUserRef. An error with no screen name does not appear there. - For an unexpected exit, times are measured from the last step because the crash time is unknown.
- Turn it off with the
errorTrailsetting (in Laravel:NABD_ERROR_TRAIL=false).
Extra data
Only these keys are allowed in meta; any other key is dropped on the device and on the server:
taps window_ms duration_ms error_type error_fingerprint fatal http_status stepThe SDK adds the trail key itself; if you send it from your code it is dropped on the device.
Offline
Events are stored locally (at most 1000, oldest dropped first) and sent in batches: at 50 events, every two minutes, or when the app goes to the background.