Initial integration

Message events

ο»Ώ

Introduction

To keep your app informed about the user's progress within the plug-in, we transmit data via message events at various stages. This document describes the different types of events, when they are sent, and their data format. The events are in JSON format and contain information about the Face Scan's progress.

Prerequisites

Make sure you've gone through the following documentation:

To learn how to listen for these data messages in web apps, refer to the Listening to message eventsο»Ώ page.

Overview

We currently distinguish the following events:

  • StartNewMeasurement
  • RecordingStarted
  • RecordingStopped
  • FaceScanSuccessful
  • UserFinished
  • Dismiss
  • Error (informative)

Summary of event occurrences

When the user clicks the 'Perform Measurement' button on the welcome screen, a startNewMeasurement event is sent. Upon reaching the recording screen, users encounter the camera stream along with a start button. Pressing the start button initiates the quality-checking process. If the conditions are favourable and the check passes, the actual recording starts and a recordingStarted event is sent. The timer begins counting down, and upon reaching zero, the measurement concludes, prompting a recordingStopped event. The subsequent events depend on the outcome of the measurement.

If the measurement is successful, a faceScanSuccessful event is sent, indicating that the results are available and can be requested via the API.

However, there might be instances where the quality deteriorates too much during the Face Scan, rendering an accurate assessment unfeasible. For instance, this could occur if the lighting abruptly dims. In such cases, an errorevent is sent and users are presented with two choices: they can restart the Face Scan by selecting the β€˜try again’ option, or they can opt to conclude the Face Scan without completing it successfully by clicking the β€˜continue’ button. Choosing the 'try again' option brings them back to the start of the Face Scan process. If they select the 'continue' option, no biomarker results will be generated, and a userFinished event will be sent.

The dismiss event is sent whenever the web plugin should be closed.

The event types are further explained in detail below.

Event types

The diagram below illustrates the different stages within the plug-in and the corresponding events triggered.

Document image
ο»Ώ

Start New Measurement

Sent when the user clicks on the 'Perform Measurement' button on the Welcome screen.

Event Data

Success
ο»Ώ
  • stage: "startNewMeasurement"
  • data: Additional details
    • onboarding: boolean; when True, the user first landed on the onboarding screen. When False, the user immediately advanced to the recording screen.

ο»Ώ

Recording Started

Sent when the user clicks the record button and the timer starts.

Event Data

Success
ο»Ώ
  • stage: "recordingStarted"
  • uuid: Face Scan ID (unique ID of the Face Scan)

Recording Stopped

Sent when the recording stopped, i.e. the recording timer ends.

Event Data

Success
ο»Ώ
  • stage: "recordingStopped"
  • uuid: Face Scan ID (unique ID of the Face Scan)

Face Scan Successful

Sent when the result are available and can be requested via the API.

Event Data

Success
ο»Ώ
  • stage: "faceScanSuccessful"
  • uuid: Face Scan ID (unique ID of the Face Scan)
  • data: Reserved for future use

User Finished

Occasionally, the conditions may deteriorate while performing the Face Scan, making an accurate health assessment unfeasible. For instance, this might happen if the lighting suddenly gets very dim. In such instances, users are presented with two choices: they can restart the health check by selecting the β€˜try again’ option, or they can opt to conclude the health check without completing it successfully by clicking the β€˜continue’ button. If they select the latter option, no biomarker results will be generated. We will notify you of this outcome with a β€œuserFinished” event.

This event is also sent when the user's device does not have a camera or when the necessary permissions to access the camera have not been granted.

Sent in the situation where the user ends the health scan without successfully performing a measurement.

Event Data

JSON
ο»Ώ
  • stage: "userFinished"
  • data: Reserved for future use

Dismiss

We will notify you with a "dismiss" event when the web plugin can be closed. This can be because of the following reasons:

  • The user chose to abort the health check without starting it, i.e. by clicking the "return" button
  • The measurement is finished and the results are available (only sent when not using the built-in results screen)
  • The user chose to continue without performing the health scan

Sent when the web plugin should be closed.

Event Data

JSON
ο»Ώ
  • stage: "dismiss"
  • data: Reserved for future use

ο»Ώ

ο»Ώ