Aller au contenu principal

Web

Embedding the iframe in a regular web page is the most common scenario. You drop an <iframe> tag into your markup and listen for messages on window.

Embed​

<iframe
src="https://iframe.legit.health/?company=YOUR_COMPANY_ID"
width="100%"
height="800"
></iframe>

For the full URL parameter reference, see the Configure → Customize page.

Listen for messages​

window.addEventListener("message", function (event) {
switch (event.data.message) {
case "analysis_completed":
handleAnalysisCompleted(event.data.id);
break;
case "image_rejected":
handleImageRejected(event.data.payload);
break;
case "invalid_company_key":
handleInvalidKey(event.data.id);
break;
}
});

See the Callbacks section for the full catalogue.

Next Steps​

  • Understand each callback type? See the Callbacks section.
  • Ready to retrieve the report? See the Output → API Endpoint page.
  • Want to display the results? See the Output → User Interface page.