@getyoti/yoti-doc-scan-react-native

中文文档
8.0.0发布于 2026/07/06https://www.yoti.com/terms/identity-verificationCommonJS零依赖近 30 天下载 3210

A react native SDK for Yoti's identity verification services

原始使用文档
文档目录13 节
  1. Prerequisites
  2. Requirements
  3. Integration
  4. Android
  5. iOS
  6. Usage
  7. 1. Import module
  8. 2. Optional configuration and customization
  9. 3. Launch a session
  10. Supported languages
  11. Status codes
  12. Support
  13. Licence

Yoti IDV, React Native

GitHub tag (latest SemVer) Publish Release Illustration

A react native wrapper of Yoti IDV for Android and iOS. Yoti IDV allows a user of your app to take a photo of their document, as well as to scan or capture their face, we then verify this instantly and prepare a response, which your system can then retrieve on your hosted site.

Prerequisites

To integrate with Yoti IDV, a working infrastructure is needed (see developers.yoti.com for more details or get in touch with us here).

Requirements

Integration

Start your integration by adding the following dependency to your package.json file:

"dependencies": {
    "@getyoti/yoti-doc-scan-react-native": "^8.0.0"
}

Android

Continuing with your integration for Android, add the following property and repository to your project's build.gradle file:

buildscript {
    ext {
        yotiSdkVersion = "4.3.0"
    }
}
allprojects {
    repositories {
        maven {
            url 'https://maven.regulaforensics.com/RegulaDocumentReader'
        }
    }
}

Now add any of these optional dependencies to your app's build.gradle file:

dependencies {
    // With automatic capture via OCR and NFC capture
    implementation "com.yoti.mobile.android.sdk:yoti-sdk-doc-scan:${rootProject.ext.yotiSdkVersion}"
    // With manual capture only, no OCR, no NFC - around 14Mb smaller in size
    implementation "com.yoti.mobile.android.sdk:yoti-sdk-doc-scan-slim:${rootProject.ext.yotiSdkVersion}"
    implementation "com.yoti.mobile.android.sdk:yoti-sdk-doc-scan-sup:${rootProject.ext.yotiSdkVersion}"
    implementation "com.yoti.mobile.android.sdk:yoti-sdk-liveness-zoom:${rootProject.ext.yotiSdkVersion}"
    // With embedded AI model
    implementation "com.yoti.mobile.android.sdk:yoti-sdk-facecapture:${rootProject.ext.yotiSdkVersion}"
     // Without embedded AI model - around 20 MB smaller in size
    implementation "com.yoti.mobile.android.sdk:yoti-sdk-facecapture-unbundled:${rootProject.ext.yotiSdkVersion}"
}

If you're using Proguard or another obfuscation tool, you should also add the following configuration rules to your proguard-rules.pro file:

-keepclassmembers class kotlinx.** {
    volatile <fields>;
}
-keep class com.yoti.** { *; }
-dontwarn com.facetec.sdk.**
-keep class com.facetec.sdk.** { *; }
-dontwarn javax.annotation.Nullable
-keepclassmembers class io.ktor.** { volatile <fields>; }

iOS

To continue your integration with iOS, you should add the following to your Podfile and run pod install from its directory:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'

platform :ios, '15.1'

target 'TargetName' do
  config = use_native_modules!
  use_react_native!(:path => config[:reactNativePath])
  use_frameworks!
  use_native_modules!
  pod 'YotiDocumentScan'                # Include if `YotiSDKIdentityDocument` is included and to support identity document OCR
  pod 'YotiNFC'                         # Include if `YotiSDKIdentityDocument` is included and to support identity document NFC
  pod 'YotiSDKIdentityDocument'         # Optional
  pod 'YotiSDKSupplementaryDocument'    # Optional
  pod 'YotiSDKFaceTec'                  # Optional
  pod 'YotiSDKFaceCapture'              # Optional

  # If your target includes `YotiSDKFaceTec`, then you must also provide `FaceTecSDK` per build configuration.
  # ENV['YOTI_FACETEC_VERSION'] = '9.0.0' # Uncomment to pin FaceTec to a specific 'yoti-doc-scan-ios' version (defaults to latest)
  pod 'FaceTecSDK', :podspec => '../node_modules/@getyoti/yoti-doc-scan-react-native/ios/Podspecs/FaceTecSDK.podspec', :configurations => ['Release']
  pod 'FaceTecSDKForDevelopment', :podspec => '../node_modules/@getyoti/yoti-doc-scan-react-native/ios/Podspecs/FaceTecSDKForDevelopment.podspec', :configurations => ['Debug']
end

In addition, you should modify the properties and capabilities of your project's target.

Usage

1. Import module

import RNYotiDocScan from '@getyoti/yoti-doc-scan-react-native';

2. Optional configuration and customization

For customization on Android, you can refer to the documentation outlined here. In addition, you can choose to also set a request code:

RNYotiDocScan.setRequestCode(0); // default: 9001

On iOS, the SDK expects a launched session to contain multiple flows by default. To enable a single-flow session, configure and include yoti-doc-scan-react-native-configuration-ios.json in your project’s target and then set the configuration as follows:

RNYotiDocScan.setConfiguration({
    bundle_identifier: "", // Optional: defaults to the main bundle identifier if not specified.
    filename: "yoti-doc-scan-react-native-configuration-ios.json"
});

Ensure that only one module type property is set to true when single_flow is enabled.

To customize the appearance on iOS, you can configure the SDK using yoti-doc-scan-react-native-configuration-with-theme-ios.json instead, which supports the following options for theming:

  • Light and dark mode color themes. We also support specifying only a primary color for each mode
  • Typography theme (system and custom fonts, font weight, size, line height multiple and kern)
  • Spacing mode (compact, regular and relaxed)
  • Shape theme (corner radius and border width)
  • Icon theme (custom vectors, system and custom SF Symbols, incl. localized ones)
  • Illustration theme (custom vectors)

All customisation types are optional, and can be set independently from each other.

3. Launch a session

Launch a session with its required parameters using the start function.

const completion = (code, description) => {
    ...
}
RNYotiDocScan.start(sessionID, sessionToken, completion);

Supported languages

Our SDK supports the 9 languages listed in the table below, but their use is driven by the localization configuration of your target. If your target only supports a subset of our SDK's supported languages, our SDK will fall back to English on the ones your target doesn't support.

LanguageCode
Arabicar
Dutchnl
English (default)en
Frenchfr
Germande
Italianit
Russianru
Spanishes
Turkishtr

Status codes

CodeDescription
0The user completed the session
1000The user cancelled the session
2000Unauthorised request (wrong or expired session token)
2001Session not found
2002Session expired
2003SDK launched without a session token
2004SDK launched without a session id
3000Yoti's services are down or unable to process the request
3001An error occurred during a network request
3002The user did not have a network connection
3003A network request timed out
4000The user did not grant permission to the camera
4001The user submitted a wrong document
5000The user's camera was not found and file upload is not allowed
5002No more local tries for the liveness flow
5003SDK is out-of-date, please update the SDK to the latest version
5004An unexpected internal error occurred
5005An unexpected document capture error occurred
5006An unexpected liveness capture error occurred
5008An unsupported configuration was used
6000The identity document dependency could not be found
6001The face scan dependency could not be found
6002The supplementary document dependency could not be found
6003The face capture dependency could not be found
7000The user did not have the required documents

Support

For any questions or support please contact us here. Once we have answered your question, we may contact you again to discuss Yoti products and services. If you'd prefer us not to do this, please let us know when you e-mail.

Licence

See the licence here.

版本与发布记录

@getyoti/yoti-doc-scan-react-native 共发布 14 个版本,首次发布于 2023/08/04;过去 12 个月发布了 5 个版本。

版本发布日期距今
8.0.0latest2026/07/064 个月前
7.0.02026/02/208 个月前
6.0.02026/01/239 个月前
5.0.22025/11/1811 个月前
6.0.0-alpha.22025/11/1811 个月前
6.0.0-alpha.12025/10/241.1 年前

关于 @getyoti/yoti-doc-scan-react-native 的常见问题

@getyoti/yoti-doc-scan-react-native 是什么?

A react native SDK for Yoti's identity verification services

如何安装 @getyoti/yoti-doc-scan-react-native?

在项目目录运行 npm install @getyoti/yoti-doc-scan-react-native,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=19.1.0)、react-native(>=0.80.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@getyoti/yoti-doc-scan-react-native 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/getyoti__yoti-doc-scan-react-native 是否存在。

@getyoti/yoti-doc-scan-react-native 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@getyoti/yoti-doc-scan-react-native 可以商用吗?

@getyoti/yoti-doc-scan-react-native 使用 https://www.yoti.com/terms/identity-verification 许可。声明的许可为 https://www.yoti.com/terms/identity-verification,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@getyoti/yoti-doc-scan-react-native 的下载量有多少?

根据 npm 官方下载统计,@getyoti/yoti-doc-scan-react-native 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,210 次,日均约 107 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@getyoti/yoti-doc-scan-react-native 还在维护吗?

最新版本 8.0.0 发布于 2026/07/06(4 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 5 个;首次发布于 2023/08/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。