This event is emitted by the Ditto 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 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:
This document describes the structure and meaning of the fields returned by the onInitialized event emitted by the Ditto 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 Ditto 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).
jwtJsonTokenInfo
String
JWT token issued during initialization (may be empty initially).
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.).
supportedLanguage
String
JSON arrya sting denotes the supported languages includes the lang(language name), display_text(display text for language) and the direction (direction for text)
selectedLanguage
String
Denotes current selected lanague for the SDK.
app_messages
String
Localized string messages required for App.
🧪 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:
This event is critical for accessing session-related data before any secured API call or workflow can begin.
📱 Platform-specific Integration
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("DITTO-ID", "onInitialized event received");
// Implement your logic here
}
✅ Next Steps
Use sessionID and settings to initialize app-level session.