Register/Enroll

Running SmartSelfie™ Authentication (Register) on React Native

  1. Create a Callback Endpoint

  2. Get your user's Selfie

  3. Register the user

  4. Submit the Job to Smile ID

  5. Interpret your results

Registering a User

The SmartSelfie™ Authentication entails comparing a SmartSelfie™ against the Selfie on file of a registered user. To register a user, the job request payload is exactly the same as a SmartSelfie™ Authentication except for two differences (both changes are to be made in the Making a Job Request section of this page):

  1. Since you are just registering the user, you need a new user_id (details of Key in Making a Job Request section of this page)

  2. Set the job_type to "4" (details of Key in Making a Job Request section of this page)

If you are performing a SmartSelfie™ Authentication for a user you've previous Registered or performed ran a successful Biometric KYC or Document Verification on, you can skip the "Registering a User" section in the rest of this page.

Get the User's Selfie

To successfully run SmartSelfie™ Authentication (Registration) jobs you need to submit the user's selfie.Please see SmartSelfie capture as specified here, it is important to recognise that the tag supplied and or returned from this is what will need to be used to submit the Job

Submit the Job to Smile ID

const partnerParams = {
    "job_id":<YOUR JOB ID>,
    "user_id":<YOUR USER ID>, // see option 2 on how to update this
    ...
    "<OTHER_KEY>":<OTHER_KEY_VALUE>
    ...
}

Step 2: Optional Set User ID Information for re-enroll/updating selfie

This can be then submitted in the submit method

// Some code
//Instantiation
const userIdInfo = { 
  "allow_re_enroll": true/false, //allow the user to be reenrolled
                                //do not pass if the user has not been enrolled
  "use_enrolled_image": true/false // will allow to update enrolled selfie
}

Step 3: Optional Set Geo Information

const geoInfo = {
  accuracy: number
  altitude: number,
  latitude: number,
  longitude: number,
  lastUpdate: string,
  isGeoPermissionGranted: boolan
}

Step 4: Submit the Job

try { 
const result = await RnSmileId.submitJob(
                tag: string,
                jobType: number,
                isProduction: boolean,
                partnerParams: object,//optional pass {} when not available
                idInfo: object,//optional pass {} when not available
                geoInfo: object//optional pass {} when not available
                callbackUrl: string//optional pass '' when not available
                jobStatusPollingTimeoutMillis:number //optional pass 0 when not available
              );
} catch (e) {
  //handle errors
}
  • jobType should be set to 4 and is required

  • isProduction (required)should be set to true if you intent to run in production and false if you intend to run in sandbox, it is important to note you cannot run real ID Numbers check on sandbox, for test data please see here

  • callBackUrl (Optional)can be null but if not it should be a url which the job data will be posted to depending on the status the job is in

  • partnerParams (Optional)This is the object create in the step above related to partner params

  • geoInfo (Optional) This is any information that may be necessary to associate the job with any geolocation

  • jobStatusPollingTimeoutMillis => (optional) pass 0 if not needed. This will be the time to wait for job status polling , note if set to a smaller number this will return a complete false result from job status and results will be delivered to the callback

Step 4: Interpret your results

The result hashmap will be an object which will contain results returned from the api this contains strongly typed method to get the response as individual items or as json object or as a string, for more information on how to interpret results you can read more about result codes and responses in the SmartSelfie™ Authentication section of the docs.

Last updated