Options¶
Pass options once, to init. They are read when the SDK starts. A later init call returns the
running session and keeps the first call's options.
import * as Dea from '@dea/react-native';
await Dea.init({
appId: 'YOUR_APP_ID',
requireConsent: true,
consent: undefined,
motionRate: 50,
appKey: 'YOUR_APP_KEY',
playIntegrityProject: 123456789012,
countTargets: false,
debug: false,
});
Telemetry, the SDK's log and the input it captures, reaches your app on the staging and test packages: see Telemetry.
Core options¶
appId¶
| Type | Default | Required |
|---|---|---|
string |
— | Yes |
The appId DEA issued for this app — see
Accounts and keys. A missing or blank appId logs
sdk.app_id_missing in the native log of a staging or test native build.
appKey¶
| Type | Default | Required |
|---|---|---|
string |
undefined |
Yes, for Attest |
The appKey DEA issued together with this platform's appId: the iOS app's key on iOS, the
Android app's key on Android. Without it, attest() resolves unsupported
without contacting DEA, and its detail starts with no appKey. Capture and the classification do
not need it. See Accounts and keys.
requireConsent¶
| Type | Default | Required |
|---|---|---|
boolean |
true |
No |
When true, nothing is recorded until the user has agreed. See
User Consent.
Set it to false only when consent is already established outside the SDK — for example, your app
asks during onboarding and calls init only after the user agrees.
consent¶
| Type | Default | Required |
|---|---|---|
boolean |
unset | No |
The answer your app already has, when it asked the user before calling init. true records a
grant and false a refusal, applied before the first event is captured, so a user who has just
said yes is not missed. The answer is stored on the device like one recorded with setConsent.
Leave it unset to keep the answer stored on the device from an earlier launch.
On a repeat init call, Android still records a consent it is given; iOS ignores it. Use
setConsent to record an answer after the first init.
debug¶
| Type | Default | Required |
|---|---|---|
boolean |
false |
No |
Android only. Writes SDK diagnostics and one line per captured event to standard output, which
appears in Logcat, and only with an SDK build of the test channel; the SDK you ship prints
nothing. Ignored on iOS. Never enable it in production builds.
Capture options¶
events¶
| Type | Default | Required |
|---|---|---|
CaptureEvent[] |
unset — the native SDK's default | No |
The input kinds to capture. Unset or empty keeps the native SDK's default. Capturing fewer kinds reduces work but also reduces the evidence the score is built on.
| Value | Captures |
|---|---|
'pointerDown' |
A finger or stylus touches the screen |
'pointerMove' |
A touch moves, and a pointer hovers |
'pointerUp' |
A touch ends |
'pointerCancel' |
The system cancels a touch |
'wheel' |
Trackpad and mouse scrolling |
Android captures the four pointer kinds together: naming any one of them captures all four.
Motion, app lifecycle and captureEvent markers are always captured on Android. A name not in the
table rejects init with code E_DEA and the message no capture event named '<name>'.
idleMotionMs¶
| Type | Default | Required |
|---|---|---|
number (ms) |
3000 |
No |
When no one is touching the screen, motion data is kept at a reduced rate — one reading every
idleMotionMs — until the next touch. 0 keeps every reading.
touchMarginMs¶
| Type | Default | Required |
|---|---|---|
number (ms) |
200 |
No |
Motion data is kept at the full rate for this long before and after each touch, even while idle.
motionRate¶
| Type | Default | Required |
|---|---|---|
number (Hz) |
50 |
No |
Android only. The accelerometer and gyroscope rate to request. 0 or unset uses the default.
Once motion samples arrive, getSessionInfo().device.sensorRate reports the rate requested; it
stays 0 until the first sample arrives, and on a device that delivers none. iOS always uses the
SDK's default rate, 50 Hz.
countTargets¶
| Type | Default | Required |
|---|---|---|
boolean |
false |
No |
Counts which kind of control every press landed on, for reading with getTargetTally().
Warning:
countTargetshas no effect with a productionappId. The native SDKs refuse the counter there, sogetTargetTally()resolves an empty object whatever you pass here.
Attestation options¶
playIntegrityProject¶
| Type | Default | Required |
|---|---|---|
number |
undefined |
Yes on Android, for Attest. Ignored on iOS |
Android only. The Google Cloud project number DEA issued for your Android app, together with
its appId and appKey. See Attest.
registryAppId¶
| Type | Default | Required |
|---|---|---|
string |
undefined |
No |
Deprecated. Ignored since 0.20.8. Proofs carry no
appId: DEA takes the app from the device key that signed the proof, and checks that it is the app ofappKey. The option stays so existing apps still compile. Remove it when you next update.
Model options¶
The SDK scores with a model built into it. With modelUpdates on, the native SDK also asks DEA's
model server whether a newer model is published, and downloads it only when it is newer than the
one running. Checks run in the background: nothing waits for them, and they never throw.
modelUpdates¶
| Type | Default | Required |
|---|---|---|
boolean |
true |
No |
Set it to false to stop the checks. Any downloaded model is deleted when the SDK starts, and the
SDK scores with the built-in model.
modelDirectory¶
| Type | Default | Required |
|---|---|---|
string |
unset — the native SDK's default folder | No |
The absolute path of the folder that keeps a downloaded model. Unset takes the native default: the
app's noBackupFilesDir on Android, Application Support on iOS.
modelTimeoutMs¶
| Type | Default | Required |
|---|---|---|
number (ms) |
30000 |
No |
How long one model request may take before it is abandoned. 0 or below keeps the default.
Reserved¶
DeaConfig has one more field, reserved for DEA's own tooling. Leave it unset:
| Field | What it does |
|---|---|
modelUrlOverride |
Ignored with a production appId |