Plug-in
...
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 results in json format once the measurement is finished this allows you to use the results on your parent website, enabling you to link actions based on the outcome or design a custom results screen 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 screen url docid\ ljch0hjenc dtech0poye ) or just get the data using our results api docid\ b6xch2owpqmrgywogjrza api endpoint basic concept the plug in iframe incorporates a mechanism that allows it to communicate message events, such as biomarker results, 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\ nhmyw3igywbv wbatholb page to allow for seamless integration of the iframe in your website, matching your brand's colours and fonts, please visit our customisation docid 0ukxybkmvpnt1kv0jgwml documentation