Security Mode | Security Level | Capability Description | Scenarios | Required License |
Basic Edition | Standard | Basic liveness detection and face verification capabilities. | General business scenarios, scenarios with standard security requirements | YTFaceSDK.license (Basic Authorization) |
Enhanced Edition (Enhance Mode) | High | Adds device risk control capabilities on top of the Basic Edition, enhancing device security and liveness detection accuracy. | Scenarios with high security requirements, such as financial account opening and critical account verification | YTFaceSDK.license (Basic Authorization) |
Plus Edition (Plus Mode) | Extremely high | Liveness detection + face 1:1 recognition + device risk control + AI protection shield | Scenarios with extremely high security requirements, such as large-amount transactions and sensitive information modification. | YTFaceSDK.license (Basic Authorization) |

Token for orchestrating the selfie verification process and use the Token to obtain the final verification result.
package mainimport ("encoding/json""log""net/http""os""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"faceid "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/faceid/v20180301")var FaceIdClient *faceid.Clientfunc init() {// Initialize the client configuration object. You can specify the timeout and other configuration items.prof := profile.NewClientProfile()prof.HttpProfile.ReqTimeout = 60// TODO: Replace with the SecretId and SecretKey of your calling account.credential := cloud.NewCredential("SecretId", "SecretKey")var err error// Initialize the client for calling the eKYC selfie verification serviceFaceIdClient, err = faceid.NewClient(credential, "ap-singapore", prof)if nil != err {log.Fatal("FaceIdClient init error: ", err)}}// writeJSON outputs a unified JSON response: sets Content-Type and status code, then encodes and writes it.func writeJSON(w http.ResponseWriter, status int, v interface{}) {w.Header().Set("Content-Type", "application/json; charset=utf-8")w.WriteHeader(status)_ = json.NewEncoder(w).Encode(v)}// GetFaceIdToken obtains the Face Identity Verification Token.func GetFaceIdToken(w http.ResponseWriter, r *http.Request) {log.Println("get face id token")// Step 1: Parse the request parameters.if err := r.ParseForm(); err != nil {http.Error(w, "bad request", http.StatusBadRequest)return}var CheckMode = r.FormValue("CheckMode")var SecureLevel = r.FormValue("SecureLevel")var MetaData = r.FormValue("MetaData")var Image = r.FormValue("Image")// Step 2: Initialize the request object and assign values to the necessary parameters.request := faceid.NewGetFaceIdTokenIntlRequest()request.CheckMode = &CheckModerequest.SecureLevel = &SecureLevelrequest.MetaData = &MetaDataif CheckMode == "compare" {request.Image = &Image}// Step 3: Call the Face Identity Verification service via FaceIdClient.response, err := FaceIdClient.GetFaceIdTokenIntl(request)// Step 4: Process the TencentCloud API response and construct the return object.if nil != err {writeJSON(w, http.StatusInternalServerError, map[string]string{"code": "Error","message": err.Error(),})return}SdkToken := response.Response.SdkTokenServerParamInfo := response.Response.ServerParamInfoapiResp := struct {SdkToken *string `json:"SdkToken"`ServerParamInfo *string `json:"ServerParamInfo"`}{SdkToken: SdkToken, ServerParamInfo: ServerParamInfo}// ... Other business processing code.// Step 5: Return the service response.writeJSON(w, http.StatusOK, apiResp)}// GetFaceIdResult obtains the Face Identity Verification result.func GetFaceIdResult(w http.ResponseWriter, r *http.Request) {// Step 1: ... Parse the request parameters.if err := r.ParseForm(); err != nil {http.Error(w, "bad request", http.StatusBadRequest)return}SdkToken := r.FormValue("SdkToken")// Step 2: Initialize the request object and assign values to the necessary parameters.request := faceid.NewGetFaceIdResultIntlRequest()request.SdkToken = &SdkToken// Step 3: Call the Face Identity Verification service via FaceIdClient.response, err := FaceIdClient.GetFaceIdResultIntl(request)// Step 4: Process the TencentCloud API response and construct the return object.if nil != err {writeJSON(w, http.StatusInternalServerError, map[string]string{"code": "Error","message": err.Error(),})return}result := response.Response.ResultapiResp := struct {Result *string}{Result: result}b, _ := json.Marshal(apiResp)// ... Other business processing code.// Step 5: Return the service response.writeJSON(w, http.StatusOK, apiResp)}func main() {// Register the http API path.http.HandleFunc("/api/v1/get-token", GetFaceIdToken)http.HandleFunc("/api/v1/get-result", GetFaceIdResult)// Listen on the port.err := http.ListenAndServe(":8080", nil)if nil != err {log.Fatal("ListenAndServe error: ", err)}}
SdkToken is returned normally. Access the http://IP address:port/api/v1/get-result API to check whether the response of the Result field is 0, thereby determining whether the server-side integration is successful. For detailed response results, refer to the API section.├── codedemo│ ├── build.gradle│ ├── libs│ │ ├── huiyansdk_android_overseas_1.x.x.x_release.aar│ │ ├── huiyanaudio-oversea_1.x.x_release.aar (Optional, required when voice broadcast is enabled)│ │ ├── tencent-ai-sdk-aicamera-1.x.x.x-release.aar│ │ ├── tencent-ai-sdk-common-1.x.x.x-release.aar│ │ ├── tencent-ai-sdk-network-1.x.x.x-release.aar│ │ ├── tencent-ai-sdk-risk-oversea-1.x.x.x-release.aar│ │ └── tencent-ai-sdk-youtu-base-1.x.x.x-release.aar│ ├── proguard-rules.pro│ └── src│ └── main
// Set ndk so architecture filtering (taking arm64-v8a as an example; add armeabi-v7a if the device supports it)defaultConfig {ndk {abiFilters 'arm64-v8a'}}dependencies {// Import the eKYC SDK.implementation files("libs/huiyansdk_android_overseas_1.x.x.x_release.aar")// eKYC General Algorithm SDKimplementation files("libs/tencent-ai-sdk-youtu-base-1.x.x.x-release.aar")// General Capability Component Libraryimplementation files("libs/tencent-ai-sdk-common-1.x.x.x-release.aar")implementation files("libs/tencent-ai-sdk-aicamera-1.x.x.x-release.aar")implementation files("libs/tencent-ai-sdk-network-1.x.x.x-release.aar")implementation files("libs/tencent-ai-sdk-risk-oversea-1.x.x.x-release.aar")// Optional: Voice broadcast resource package (only required when voice broadcast is enabled, that is, when HuiYanOsConfig.setOpenAudio(true) is called)implementation files("libs/huiyanaudio-oversea_1.x.x_release.aar")// Third-party libraries required by the SDK.// gsonimplementation 'com.google.code.gson:gson:2.8.9'}
<!-- Camera Permission --><uses-permission android:name="android.permission.CAMERA" /><uses-featureandroid:name="android.hardware.camera"android:required="true" /><!-- Network Permission Required by the SDK --><uses-permission android:name="android.permission.INTERNET" /><!-- Device Risk Control Dependencies --><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><!-- Optional Permissions for the SDK --><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@Overridepublic void onCreate() {super.onCreate();instance = this;// The SDK must be initialized when the Application initializes.HuiYanOsApi.init(getApp());}

// Parameters related to HuiYanOsHuiYanOsConfig huiYanOsConfig = new HuiYanOsConfig();// This license file is stored under the assets directory.huiYanOsConfig.setAuthLicense("YTFaceSDK.license");// Pass through the ServerParamInfo issued by the TencentCloud API (returned together when applying for the SdkToken; required).huiYanOsConfig.setServerParamInfo(serverParamInfo);if (compatCheckBox.isChecked()) {huiYanOsConfig.setPageColorStyle(PageColorStyle.Dark);}// Start the selfie verification method to initiate liveness detection. The currentToken is data issued by the backend.HuiYanOsApi.startHuiYanAuth(currentToken, huiYanOsConfig, new HuiYanOsAuthCallBack() {@Overridepublic void onSuccess(HuiYanOsAuthResult authResult) {// Display ResultrunOnUiThread(new Runnable() {@Overridepublic void run() {Toast.makeText(SimplifyActivity.this, "Liveness passed!", Toast.LENGTH_SHORT).show();}});}@Overridepublic void onFail(int errorCode, String errorMsg, String token) {String msg = "Liveness failed " + "code: " + errorCode + " msg: " + errorMsg + " token: " + token;Log.e(TAG, "onFail" + msg);// Display ResultrunOnUiThread(new Runnable() {@Overridepublic void run() {Toast.makeText(SimplifyActivity.this, msg, Toast.LENGTH_SHORT).show();}});}});
├── codedemo│ ├── build.gradle│ ├── libs│ ├── proguard-rules.pro│ └── src│ └── main│ └── assets│ └── YTFaceSDK.license
@Overrideprotected void onDestroy() {super.onDestroy();// Release resources upon exitHuiYanOsApi.release();}
#SDK Obfuscation Includes-keep class com.tencent.could.huiyansdk.** {*;}-keep class com.tencent.could.aicamera.** {*;}-keep class com.tencent.could.component.** {*;}-keep class com.tencent.youtu.** {*;}-keep class com.tenpay.utils.SMUtils {*;}-keep class com.tencent.turingface.** {*;}-keep class com.turingface.sdk.** {*;}-keep class com.tencent.cloud.ai.network.** {*;}
├──Accelerate.framework└──HuiYanOverseasSDK.xcframework

├──YTFaceSDK.license├──face-tracker-v003.bundle├──HuiYanSDKUI.bundle└──HuiYanAudioBundle.bundle (Optional)

├──Your Project.xcodeproj├──Podfile├──CloudHuiYanSDK_FW├───────CloudHuiYanSDK_FW.podspec├───────Frameworks├────────────HuiYanOverseasSDK.xcframework├───────Resources├────────────HuiYanSDKUI.bundle├────────────HuiYanAudioBundle.bundle└────────────face-tracker-v003.bundle
Pod::Spec.new do |s|s.name = "CloudHuiYanSDK_FW"s.version = "1.0.0"s.platform = :ios, "15.0"s.summary = 'frameworks and bundle resources for youtu mobile hdr's.homepage = 'xx's.license = 'MIT's.source = {:git => 'xx' ,:tag => "#{s.version}"}s.static_framework = trues.compiler_flags = "-ObjC"s.author = {'xx' => 'xx'}s.pod_target_xcconfig = {'VALID_ARCHS' =>['arm64', 'x86_64']}s.subspec 'Resources' do |framework|framework.resource = 'Resources/*.bundle'ends.subspec 'Framework' do |framework|framework.frameworks = 'Accelerate'framework.vendored_frameworks = 'Frameworks/*.xcframework'endend
target 'HuiYanAuthDemo' douse_frameworks!pod 'CloudHuiYanSDK_FW', :path => './CloudHuiYanSDK_FW'end
Build Settings, add $(inherited) to Framework Search Paths.
Build Settings, add $(inherited) to Other Linker Flags.
key-value pairs.<key>Privacy - Camera Usage Description</key><string>Face Identity Verification requires enabling your camera permission for Face Recognition.</string>

#import <HuiYanOverseasSDK/HuiYanSDK.h>// Obtain the token.NSString *faceToken = self.tokenTextField.text;// Configure the SDK.HuiYanOsConfig *config = [[HuiYanOsConfig alloc] init];// Set the license.config.authLicense = [[NSBundle mainBundle] pathForResource:@"YTFaceSDK" ofType:@"license"];// Preparation Phase Timeout Configurationconfig.prepareTimeoutMs = 20000;// Action Phase Timeout Configurationconfig.actionTimeoutMs = 20000;// Delete the local liveness video.config.isDeleteVideoCache = YES;// Set UI-related callbacks.config.delegate = self;// Custom Multilingual Configurationconfig.languageType = EN;// config.userLanguageFileName = @"ko";// config.userLanguageBundleName = @"UseLanguageBundle";config.iShowTipsPage = YES;[[HuiYanOSKit sharedInstance] startHuiYaneKYC:faceToken withConfig:config withSuccCallback:^(HuiYanOsAuthResult * _Nonnull authResult, id _Nullable reserved) {NSString *token = authResult.faceToken;} withFailCallback:^(int errCode, NSString * _Nonnull errMsg, id _Nullable reserved) {NSString *showMsg = [NSString stringWithFormat:@"err:%d:%@",errCode,errMsg];NSLog(@"err:%@",showMsg);}];
HuiYanOsConfig *config = [[HuiYanOsConfig alloc] init];config.authLicense = [[NSBundle mainBundle] pathForResource:@"YTFaceSDK" ofType:@"license"];
GetFaceIdTokenIntl or ApplySdkVerificationToken API to obtain a business Token, you must specify Enhanced Mode or Plus Mode by setting the SdkVersion parameter:SdkVersion value.SdkVersion value.피드백