Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

A react native SDK for Yoti's identity verification services

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
decreased by-63.16%
Maintainers
0
Weekly downloads
 
Created
Source

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": "^4.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 = "3.5.0"
    }
}
allprojects {
    repositories {
        maven {
            url 'https://maven.microblink.com'
        }
    }
}

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:

-keep class com.yoti.** { *; }
-keep class com.microblink.** { *; }
-keep class com.microblink.**$* { *; }
-dontwarn com.microblink.**
-keep class com.facetec.zoom.** { *; }
-dontwarn javax.annotation.Nullable

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, '11.0'

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
end

In addition, you should add NSCameraUsageDescription to your Info.plist.

And if you have included YotiNFC in your target, make sure to also:

Usage

1. Import module

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

2. Launch a session

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

const successCallback = (code, description) => {
    ...
}
const errorCallback = (code, description) => {
    ...
}
RNYotiDocScan.startSession(id, token, successCallback, errorCallback);

3. Customizations

On iOS, you can set the primary colors using the following API:

RNYotiDocScan.setLightPrimaryColorRGB(0, 0, 0); // default: (40, 117, 188)
RNYotiDocScan.setDarkPrimaryColorRGB(0, 0, 0); // default: (145, 190, 255)

To customize the colors on Android, please refer to its separate documentation.

In addition, you can choose to also specify a request code on Android:

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

Supported languages

Yoti IDV 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

Error codes

CodeDescription
1000No error occurred. The 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.

FAQs

Package last updated on 04 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc