Below, you can find an example on how to initiate the enrolment process for a passport enabling the reading through NFC and facial recognition:
var doc =newcordova.plugins.UqudoIdPlugin.DocumentBuilder().setDocumentType(cordova.plugins.UqudoIdPlugin.DocumentType.PASSPORT).enableReading(newcordova.plugins.UqudoIdPlugin.ReadingConfigurationBuilder().forceReadingIfSupported(true).build() ).build();var enrollObject =newcordova.plugins.UqudoIdPlugin.EnrollmentBuilder().setToken(token).enableFacialRecognition(newcordova.plugins.UqudoIdPlugin.FacialRecognitionConfigurationBuilder().build()).setAppearanceMode(cordova.plugins.UqudoIdPlugin.AppearanceMode.SYSTEM).add(doc).build();cordova.plugins.UqudoIdPlugin.enroll(enrollObject, success, failure);
In order to evaluate all the possible options please refer to paragraph Enrolment Flow. The JS interface is the porting of the JAVA one. In addition you can check UqudoIdPlugin.js inside the plugin folder or directly from your IDE.
If successful, the response is a JSON Web Signature (JWS). Please refer to section "SDK result" for further details.
In case of a failure, the callback returns the following object: