-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstatic-page.html
28 lines (27 loc) · 1000 Bytes
/
static-page.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div>
<iframe width='100%' height='800px' id="myIframe" src="https://kyc-embed-react-app-XXXX-dev.twil.io/index.html"></iframe>
</div>
<script>
const iframe = document.getElementById('myIframe')
iframe.onload = function () {
iframe.contentWindow.postMessage({
inquiryId: '%inquiry_id_from_API_request%',
inquirySessionToken: '%inquiry_session_token_from_API_request%'
}, '*') // TODO: put your embed domain here
}
window.addEventListener('message', (event) => {
if (event.origin === 'https://kyc-embed-react-app-XXXX-dev.twil.io/index.html') {
// Here you can listen to outcome events from the embedded iframe
console.log('>>> parent page received event from embed', event.data)
}
}, false)
</script>
</body>
</html>