Initial integration
...
Embed Plug-in
Embed in web app

Listening to message events

introduction this document describes how to listen for message events from the plug in within your parent website's code by doing so, you can monitor the user's progress within the plug in and obtain the id of the face scan the user performed you will need the id of the face scan to request widgets docid\ sxvsw2jfsohr7xbxeyz j or results via the api docid\ ra3fcmavxjf0i7viixq7d we cover the basic communication protocol between the plug in iframe component and your website, which we refer to as the "parent website" do note that it is also possible to fetch the results at a later point in time you can either request the plug in's entire results screen (refer to request results page url docid\ yokmru tbh2 5thrwnrxy ) or just get the data using our rest api docid\ biupvixvhltbukklr2ati api endpoint basic concept the plug in iframe incorporates a mechanism that allows it to communicate message events with the parent website, i e your website these can then be handled as needed we use the browser postmessage feature to facilitate communication between the plug in iframe component and the parent website the messages are sent at various stages, updating the parent website of the user's progress inside the plug in post messages the window\ postmessage() , which our plug in uses, is a method that safely enables communication between window objects; for example between a page and an iframe embedded within it more info on the postmessage browser feature https //developer mozilla org/en us/docs/web/api/window/postmessage https //developer mozilla org/en us/docs/web/api/window/postmessage browser support set up message listener the code below shows a basic example of how to let your parent website listen for post messages from the plug in iframe component add the js below to your website window\ addeventlistener( "message", (event) => { // access the message body via `event data` }, false, ); full example intelliprove hello world next steps to learn more about the different types of messages the plug in sends during a health check, refer to the message events docid\ kz6xsnd6v4g8efcgd02ib page to allow for seamless integration of the iframe in your website, matching your brand's colours and fonts, please visit our customisation docid\ vzz odplrstmbhthzklld documentation