CycurIDConfiguration
Overview:
CycurIDConfiguration
is a class responsible for configuring the CycurID SDK for identity verification processes within applications. It provides a streamlined interface for setting up the necessary parameters, such as API key, secret key, and user ID, required for integrating the CycurID SDK into your application.
Usage:
To use CycurIDConfiguration
, developers typically call its static method Configure(apiKey:secretKey:userId:completionHandler). This method allows developers to provide the necessary authentication credentials and a completion handler to handle the result of the configuration operation asynchronously.
Parameters:
- apiKey: A string representing the API key provided by CycurID for authentication purposes.
- secretKey: A string representing the secret key provided by CycurID for authentication purposes.
- userId: A string representing the unique identifier for the user initiating the identity verification process.
- completionHandler: A closure parameter that takes a Result enum as its argument. The Result enum indicates whether the configuration operation was successful or encountered an error. If successful, it provides an instance of CycurID for further interactions with the CycurID SDK.
Example :
- Android
- IOS
- Flutter
- React Native
CycurIDConfiguration.Configure(this, "YOUR_API_KEY", "YOUR_SECRET_KEY", "USER_ID") {cycurid, error ->
if (cycurid != null) {
// Configuration successful, `cycurid` is now ready for use
cycurid.beginProcess(CycuridType.isHuman)
} else {
// Configuration failed, handle the error appropriately
Log.i("Error", "${error}")
}
}
import imme_ios
CycurIDConfiguration.Configure(apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY", userId: "USER_ID") { result in
switch result {
case .success(let cycurid):
// Configuration successful, `cycurid` is now ready for use
cycurid.beginProcess(flow: .isHuman, delegateClass: self)
case .failure(let error):
// Configuration failed, handle the error appropriately
print("Configuration Error: \(error)")
}
}
final _flutterCycuridPlugin = FlutterCycurid();
CycurIdType type = CycurIdType.isHuman;
CycuridOptions options = CycuridOptions(userId: "USER_ID", apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY");
// Configuration successful, `cycurid` is now ready for use
_flutterCycuridPlugin.initCycurid(type, options);
import {
initCycurid,
CycurIdType,
CycuridConfig,
} from 'react-native-cycurid-sdk';
const config = new CycuridConfig(
'YOUR_API_KEY',
'YOUR_SECRET_KEY',
'YOUR_USER_ID'
);
const type = CycurIdType.isHuman;
try {
const result = await initCycurid(type, config);
console.log(result);
} catch (error) {
console.error(error);
}
Notes:
- Ensure that the provided API key, secret key are obtained from CycurID and are valid for your application.
- It's important to handle the configuration result appropriately, especially in the case of failure, to provide a smooth user experience and handle potential errors gracefully.