React-Native

Smile ID react native only works on native mobile apps and not react web. The wrapper has three main components, Selfie, ID Card and Job submission. The selfie and id card screens are already built in

1. Installation

To install the SDK run the below command in the terminal at the root of your project.

npm install rn-smile-id

2. Project Setup

Add the Smile ID config file to your app:

  1. If you have not generated your smile id API key please click here to generate an API key (Skip if you have generated an API key before)

  2. Click Download Configuration File to obtain your Smile ID config file (smile_config.json).

  3. For iOS open the ios project and place this file at the root of your project and for android place this file at the root of the main module (usually app folder) this step is critical and your project will behave unexpectedly if these are not done right.

What do you need to know about this config file?

  • The Smile ID config file contains unique, and secret identifiers for your project. Do not share this file with extenal parties

  • You can download your Smile ID config file again at any time.

  • Make sure the config file name is not appended with additional characters, like (2).

  • Do not edit the contents of the config file

The SDK Exposes this methods

//Selfie Capture
captureSelfie(tag: string): Promise<object>;
//ID Card Capture
captureIDCard(tag: string): Promise<object>;
//Capture a Selfie and ID Card in one go
captureSelfieAndIDCard(tag: string): Promise<object>;
//Submit a job
submitJob(
tag: string,
jobType: number,
isProduction: boolean,
partnerParams: object,
idInfo: object,
geoInfo: object
): Promise<object>;

SAMPLE APPLICATION

A sample application is available on github in a public repo here,