# @getyoti/yoti-doc-scan-react-native 中文文档

规范地址：https://npmcn.com/package/%40getyoti/yoti-doc-scan-react-native/

版本：8\.0\.0
npm 元数据更新时间：2026-09-15T14:02:24.076Z
中文译文更新时间：2026-11-16T07:06:38.529Z
软件包许可：https://www\.yoti\.com/terms/identity-verification

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40getyoti/yoti-doc-scan-react-native
原文对照：https://npmcn.com/package/%40getyoti/yoti-doc-scan-react-native/?lang=original
项目主页：https://github.com/getyoti/yoti-doc-scan-react-native
源码仓库：https://github.com/getyoti/yoti-doc-scan-react-native

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：161 kB，39 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- peer 依赖：react \>=19\.1\.0，react-native \>=0\.80\.3
- 首次发布：2023-08-04T09:14:51.174Z
- 最新版本发布：2026-07-06T12:58:54.354Z
- 近 30 天下载量：3210（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：14（近 12 个月 5 个）

## 中文简介

Yoti 身份验证服务的反应本地 SDK

## 安装

```sh
npm install @getyoti/yoti-doc-scan-react-native
```

也可以使用：`pnpm add @getyoti/yoti-doc-scan-react-native`、`yarn add @getyoti/yoti-doc-scan-react-native`、`bun add @getyoti/yoti-doc-scan-react-native`

## README

# Yoti IDV, 反应原生

[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/getyoti/yoti-doc-scan-react-native?label=latest%20release)](https://github.com/getyoti/yoti-doc-scan-react-native/releases) [![Publish Release](https://github.com/getyoti/yoti-doc-scan-react-native/workflows/Publish%20Release/badge.svg)](https://github.com/getyoti/yoti-doc-scan-react-native/actions?query=workflow%3A%22Publish+Release%22) ![Illustration](https://npmcn.com/package/%40getyoti/yoti-doc-scan-react-native/Illustration.png)

Yoti IDV 的本地反应包 [机器人](https://github.com/getyoti/yoti-doc-scan-android) 财务报告和审定财务报表 [iOS系统](https://github.com/getyoti/yoti-doc-scan-ios). Yoti IDV允许您的应用程序的用户拍摄他们的文档相片,以及扫描或捕捉他们的相片,然后我们立即核实并准备回复,然后您的系统可以在您的主机站点取回.

## 先决条件

为了与Yoti IDV融合,需要有一个工作基础设施(见 [开发者. yoti.com](https://developers.yoti.com/identity-verification/overview) 要更多细节或联系我们 [这里](https://developers.yoti.com/support)) (中文(简体) ).

## 所需资源

-   [机器人 SDK 4+](https://github.com/getyoti/yoti-doc-scan-android/releases)
-   [iOS SDK 9+ (英语)](https://github.com/getyoti/yoti-doc-scan-ios/releases)

## 一体化

启动您的整合, 在您的属性中添加以下 `package.json` 文件 :

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

### 机器人

继续您对 Android 的整合, 在您的项目中添加以下属性和寄存器 [`build.gradle`](https://developer.android.com/build#build-files) 文件 :

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

现在把这些可选的依赖添加到您的应用程序中 [`build.gradle`](https://developer.android.com/build#build-files) 文件 :

```groovy
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}"
}
```

使用Proguard或其他模糊工具的,还应当在您的配置中添加下列配置规则: `proguard-rules.pro` 文件 :

```groovy
-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系统

为了继续融入iOS,您应该添加以下内容: [`Podfile`](https://guides.cocoapods.org/using/the-podfile.html) 运行 `pod install` 从其目录中:

```bash
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
```

此外,你应该 [修改工程目标的性质和能力](https://github.com/getyoti/yoti-doc-scan-ios?tab=readme-ov-file#5-modify-the-properties-and-capabilities-of-your-projects-target)。 。 。 .

## 使用量

### 1\. 进口模块

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

### 2\. 可选配置和定制

关于Android的定制,可以参考概述的文档 [这里](https://github.com/getyoti/yoti-doc-scan-android?tab=readme-ov-file#customisation)。此外,还可以选择设置请求代码:

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

在iOS上,SDK预计一个被启动的会话默认会包含多个流量. 为启用单流会话,配置并包含 [yoti-doc-scan- react-intative-confuction-ios.json 互联网档案馆的存檔,存档日期2013-12-12](https://npmcn.com/package/%40getyoti/yoti-doc-scan-react-native/ios/Templates/yoti-doc-scan-react-native-configuration-ios.json) 在项目目标中,然后设定配置如下:

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

确保只设置一个模块类型属性 `true` 何时 `single_flow` 已启用.

要自定义iOS上的外观, 您可以使用 SDK 配置 [yoti-doc-scan- react-intative-confuction- with-them-ios.json 互联网档案馆的存檔,存档日期2013-12-21](https://npmcn.com/package/%40getyoti/yoti-doc-scan-react-native/ios/Templates/yoti-doc-scan-react-native-configuration-with-theme-ios.json) 相反,它支持下列主题选项:

-   光和暗模式颜色主题. 我们也支持只指定每种模式的主要颜色
-   类型学主题(系统和自定义字体、字体重量、大小、行高多重和kern)
-   间距模式(配合、正则和放松)
-   形状主题( 角半径和边框宽度)
-   图标主题(自定义向量、系统和自定义 SF 符号,包括本地化符号)
-   说明主题(定制向量)

所有自定义类型都是可选的,可以相互独立设置.

### 3\. 发起一次会议

利用 `start` 函数.

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

## 支持的语言

我们的SDK支持下表中列出的9种语言,但其使用由您目标本地化配置所驱动. 如果你的目标只支持我们SDK支持的语言的子集,那么我们的SDK会回到你的目标不支持的英语上.

| 语言 | 代码 |
| :-- | :-- |
| 阿拉伯语 | ar (单位:千美元) |
| 荷兰语Name | 无 |
| 英语( 默认) | 内 |
| 法语 | f 读取 |
| 德语 | 页:1 |
| 意大利语 | 这个 |
| 俄语 | 吕 |
| 西班牙语 | 对 |
| 土耳其语Name | 双 |

## 状态代码

| 代码 | 说明 |
| :-- | :-- |
| 0 个 | 用户完成会话 |
| 1 000个 | 用户取消了会话 |
| 联合国 | 未经批准的请求(错误或过期会话代号) |
| 联合国 | 未找到会话 |
| 联合国 | 会话已过期 |
| 联合国 | SDK 启动时没有会话符号 |
| 联合国 | SDK 没有会话 ID 启动 |
| 3000个 | Yoti 的服务中断或无法处理请求 |
| 3001 (英语) | 网络请求中发生错误 |
| 3002号 | 用户没有网络连接 |
| 3003 (英语) | 网络请求超时 |
| 4000个 | 用户没有给相机许可 |
| 4001 (英语) | 用户提交错误的文档 |
| 5000块 | 未找到用户相机, 不允许上传文件 |
| 5002 (中文(简体) ) | 别再找活口了 |
| 5003 (英语) | SDK已过时, 请更新到最新版本 |
| 5004 (英语) | 发生了出乎意料的内部错误 |
| 5005 (英语) | 发生了意外的文档抓取错误 |
| 五百零六号 | 发生了意外活性捕捉错误 |
| 5008 (英语) | 使用了不支持的配置 |
| 6000个 | 无法找到身份证件依赖性 |
| 6001 (英语) | 无法找到面部扫描依赖性 |
| 6002 (英语) | 找不到补充文件的依赖性 |
| 6003 (英语) | 无法找到面部抓取依赖性 |
| 7 000个 | 用户没有所需的文件 |

## 支助

有问题或支持请联系我们 [这里](https://support.yoti.com/)一旦我们回答了你的问题,我们可以再次与你联系,讨论Yoti产品和服务。 如果你希望我们不要这样做, 请告诉我们,当你的电子邮件.

## 许可证

见牌照 [这里](https://www.yoti.com/terms/identity-verification)。 。 。 .

## 常见问题

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

Yoti 身份验证服务的反应本地 SDK

### 如何安装 @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 和提交记录判断。

