Skip to content

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,
});

Core options

appId

Type Default Required
string — Yes

The appId DEA issued for this app — see Accounts and keys.

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.

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. Ignored on iOS. Never enable it in production builds.

Capture options

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: countTargets has no effect with a production appId. The native SDKs refuse the counter on a production account, so getTargetTally() 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.