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
onInitialized
Event Payload – Field ReferenceThis document describes the structure and meaning of the fields returned by the onInitialized
event emitted by the REL-ID SDK.
🧾 Top-Level Payload Fields
Field | Type | Description |
---|---|---|
status | Object | Contains status code and message indicating result of initialization. |
session | Object | Information about the REL-ID session such as session type and ID. |
additionalInfo | Object | Extra metadata related to the session, environment, and runtime config. |
challengeInfo | Array | Placeholder for any challenges configured to follow initialization. |
🔍 status
Object
Field | Type | Description |
---|---|---|
statusCode | Number | HTTP-like code (e.g., 100 = success). |
statusMessage | String | Message associated with the status. |
🆔 session
Object
Field | Type | Description |
---|---|---|
sessionType | Number | Indicates type of session (e.g., primary = 0). |
sessionID | String | Unique session identifier (JWT-related). |
🧩 additionalInfo
Object
Field | Type | Description |
---|---|---|
DNAProxyPort | Number | Port number used by the SDK's internal proxy. |
isAdUser | Number | Flag indicating Active Directory-based login (0 = false). |
isDNAProxyLocalHostOnly | Number | Indicates if proxy is restricted to localhost (1 = true). |
JWT | String | JWT token issued during initialization (may be empty initially). |
accessTokenInfo | String | OAuth2 access token metadata (may be empty if not fetched yet). |
settings | String | JSON-encoded configuration object (must be decoded separately). |
mtlsP12Bundle | String | Base64-encoded client SSL certificate if mutual TLS is used. |
configSettings | String | Optional app-wide config from backend, if any. |
loginIDs | Array | List of remembered login IDs on the device. |
currentWorkFlow | String | Denotes current workflow name, if any (used for IDV, etc.). |
🧪 Decoded settings
Field (as JSON)
Field | Type | Description |
---|---|---|
nfcScanEnabled | Boolean | Enables NFC scanning (for IDV). |
nfcScanTimeOut | Number | Timeout in seconds for NFC scan. |
version | String | Version 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
- Use
sessionID
andsettings
to initialize app-level session. - Listen for follow-up events like
getUser
,onUserConsentThreats
, oronTerminateWithThreats
.
Updated 3 months ago