Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script src="%VITE_SDK_URL%"></script>
<script type="module" src="/main.js"></script>
<link href="/style.css" rel="stylesheet" />
<title>Vite WebSDK Example</title>
<title>Onboarding Core Javascript Example</title>
</head>
<body>
<main id="app">
Expand Down
20 changes: 16 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand All @@ -31,7 +42,7 @@ function captureIdBackSide(response) {
onError: showError,
token: incodeSession,
numberOfTries: 3,
showTutorial: true
showTutorial: true,
});
}

Expand All @@ -49,7 +60,7 @@ function captureSelfie() {
onError: showError,
token: incodeSession,
numberOfTries: 3,
showTutorial: true
showTutorial: true,
});
}

Expand Down Expand Up @@ -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 = "<h1>Something Went Wrong</h1>";
Expand Down