onInitialized

📱 Overview


This event is emitted by the REL-ID SDK to indicate that the SDK has been successfully initialized. It is typically the first confirmation the app receives after calling the initialize() API.

The event provides important data such as:

  • App session proxy and session ID
  • SDK settings (including IDVConfig)
  • Initialization status code
  • Threat configuration and environment flags

🔌 Event Handling

onInitialized Event

React Native
// Import the necessary modules
import RdnaClient from 'react-native-rdna-client';

// This is an event handler, not a method to call directly
// Set up event listener for onInitialized event
let onInitializedSubscription = rdnaEventRegistery.addListener(
  'onInitialized', (response) => {
    // Handle the response
    console.log("onInitialized event received:", response);
    // Implement your logic here
  }
);

// Don't forget to remove the event listener when component unmounts
componentWillUnmount() {
  onInitializedSubscription.remove();
}
Flutter
import 'package:flutter/material.dart';
import 'package:rdna_plugin/rdna_plugin.dart';

// This is an event handler, not a method to call directly
// Set up event listener for onInitialized event
rdnaClient.on(RdnaClient.onInitialized, onInitialized);

// Define the callback function
void onInitialized(RDNAInitialized response) {
  // Handle the response
  print("onInitialized event received");
  // Implement your logic here
}
Cordova
// This is an event handler, not a method to call directly
// Set up event listener for onInitialized event
document.addEventListener('onInitialized', onInitialized);

// Define the callback function
function onInitialized(response) {
  // Handle the response
  console.log("onInitialized event received:", response);
  // Implement your logic here
}
Native iOS
// Objective-C
// This is an event handler, not a method to call directly
// Implement the event handler method
- (void)onInitialized:(RDNAChallengeResponse *)response {
    // Handle the response
    NSLog(@"onInitialized event received");
    // Implement your logic here
}

// Swift
// This is an event handler, not a method to call directly
// Implement the event handler method
func onInitialized(_ response: RDNAChallengeResponse) {
    // Handle the response
    print("onInitialized event received")
    // Implement your logic here
}
Native Android
// This is an event handler, not a method to call directly
// Implement the event handler method
@Override
public void onInitialized(RDNA.RDNAChallengeResponse response, RDNAError error) {
    // Handle the response
    Log.d("REL-ID", "onInitialized event received");
    // Implement your logic here
}

Event Payload

The onInitialized event provides information through its payload that your application needs to process. The structure may vary by platform but typically includes the following data:

Sample Payload

{
  "status": {
    "statusCode": 100,
    "statusMessage": ""
  },
  "session": {
    "sessionType": 0,
    "sessionID": "TCAKM61MO8SX0HL1AMSGUGBV8CJRBSU05GCLZXOYHHUWAF5O5"
  },
  "additionalInfo": {
    "DNAProxyPort": 43247,
    "isAdUser": 0,
    "isDNAProxyLocalHostOnly": 1,
    "JWT": "",
    "accessTokenInfo": "",
    "settings": "{\"IDVConfig\":{\"nfcScanEnabled\": true, \"nfcScanTimeOut\":30, \"version\":\"2.0\"}}",
    "mtlsP12Bundle": "",
    "configSettings": "",
    "loginIDs": [],
    "currentWorkFlow": ""
  },
  "challengeInfo": []
}

📦 onInitialized Event Payload – Field Reference

This document describes the structure and meaning of the fields returned by the onInitialized event emitted by the REL-ID SDK.


🧾 Top-Level Payload Fields
FieldTypeDescription
statusObjectContains status code and message indicating result of initialization.
sessionObjectInformation about the REL-ID session such as session type and ID.
additionalInfoObjectExtra metadata related to the session, environment, and runtime config.
challengeInfoArrayPlaceholder for any challenges configured to follow initialization.

🔍 status Object
FieldTypeDescription
statusCodeNumberHTTP-like code (e.g., 100 = success).
statusMessageStringMessage associated with the status.

🆔 session Object
FieldTypeDescription
sessionTypeNumberIndicates type of session (e.g., primary = 0).
sessionIDStringUnique session identifier (JWT-related).

🧩 additionalInfo Object
FieldTypeDescription
DNAProxyPortNumberPort number used by the SDK's internal proxy.
isAdUserNumberFlag indicating Active Directory-based login (0 = false).
isDNAProxyLocalHostOnlyNumberIndicates if proxy is restricted to localhost (1 = true).
JWTStringJWT token issued during initialization (may be empty initially).
accessTokenInfoStringOAuth2 access token metadata (may be empty if not fetched yet).
settingsStringJSON-encoded configuration object (must be decoded separately).
mtlsP12BundleStringBase64-encoded client SSL certificate if mutual TLS is used.
configSettingsStringOptional app-wide config from backend, if any.
loginIDsArrayList of remembered login IDs on the device.
currentWorkFlowStringDenotes current workflow name, if any (used for IDV, etc.).

🧪 Decoded settings Field (as JSON)
FieldTypeDescription
nfcScanEnabledBooleanEnables NFC scanning (for IDV).
nfcScanTimeOutNumberTimeout in seconds for NFC scan.
versionStringVersion of the IDV or settings schema.

💡

This structure helps you manage app session, feature toggles, and handle follow-up actions like user login or document verification.


🔧 Notes

  • IDVConfig is pulled from the Gateway Manager. If not configured, SDK uses default:
{
  "nfcScanEnabled": false,
  "authenticityChecksEnabled": false,
  "hologramCheckEnabled": false,
  "saveDebugLogs": false,
  "saveCroppedImages": false,
  "nfcScanTimeOut": 60,
  "version": "1.0"
}
  • This event is critical for accessing session-related data before any secured API call or workflow can begin.

✅ Next Steps