-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
44 lines (42 loc) · 1.34 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html>
<head>
<title>Transfero App</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body style="margin: 0">
<script src="https://static.sumsub.com/idensic/static/sns-websdk-builder.js"></script>
<div id="sumsub-websdk-container"></div>
</body>
</html>
<script>
function launchWebSdk(accessToken, applicantEmail, applicantPhone) {
let snsWebSdkInstance = snsWebSdk
.init(accessToken, () => this.getNewAccessToken())
.withConf({
email: applicantEmail,
phone: applicantPhone,
})
.withOptions({ addViewportTag: false, adaptIframeHeight: true })
.on("idCheck.onStepCompleted", (payload) => {
console.log("onStepCompleted", payload);
})
.on("idCheck.onError", (error) => {
console.log("onError", error);
})
.on("idCheck.onApplicantSubmitted", () => {
console.log("onApplicantSubmitted");
})
.on("idCheck.onApplicantResubmitted", () => {
console.log("onApplicantResubmitted");
})
.onMessage((type, payload) => {
console.log("onMessage", type, payload);
})
.build();
snsWebSdkInstance.launch("#sumsub-websdk-container");
}
function getNewAccessToken() {
return Promise.resolve($NEW_ACCESS_TOKEN);
}
launchWebSdk("token", "email", "phone");
</script>