diff --git a/.env.example b/.env.example index 86056bc..bc3d917 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ VITE_API_URL=https://demo-api.incodesmile.com/0 -VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.71.1.js +VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.73.1.js # HERE ONLY FOR DEMO PURPOSES, THE APIKEY AND THE FLOW_ID SHOULD NEVER BE IN THE FRONTEND. VITE_FAKE_BACKEND_APIURL=https://demo-api.incodesmile.com diff --git a/index.html b/index.html index 3df5a9d..f9eaea2 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - Vite WebSDK Example + Onboarding Core Javascript Example
diff --git a/main.js b/main.js index bc6c56f..1cb1160 100644 --- a/main.js +++ b/main.js @@ -21,7 +21,18 @@ function captureIdFrontSide() { onError: showError, token: incodeSession, numberOfTries: 3, - showTutorial: true + showTutorial: true, + onRestartOnboarding: () => { + console.log('Clicked Retry'); + container.innerHTML=""; + captureIdFrontSide(); + document.querySelector('.ReactModalPortal').remove(); + document.querySelector(".ReactModal__Body--open").classList.remove("ReactModal__Body--open"); + document.querySelector('body').removeAttribute("style"); + document.querySelectorAll('[data-react-modal-body-trap]').forEach((elem) => elem.remove()); + document.querySelector('portal').remove(); + }, + showCustomCameraPermissionScreen: true, }); } @@ -31,7 +42,7 @@ function captureIdBackSide(response) { onError: showError, token: incodeSession, numberOfTries: 3, - showTutorial: true + showTutorial: true, }); } @@ -49,7 +60,7 @@ function captureSelfie() { onError: showError, token: incodeSession, numberOfTries: 3, - showTutorial: true + showTutorial: true, }); } @@ -85,7 +96,8 @@ async function app() { // Empty the container and start the flow container.innerHTML = ""; - saveDeviceData(); + //saveDeviceData(); + captureIdFrontSide(); } catch (e) { console.dir(e); container.innerHTML = "

Something Went Wrong

";