Registration

The Registration widget allows you to easily integrate and embed the Chronomics product registration flow to allow users to register and activate their test kits. The widget collects all the required data (which varies by test type) and is fully compliant with local regulations. The flow will guide the user through the required registration steps.

Redirecting users to the registration widget

A url hosting the registration widget should be provided to your Chronomics Account Manager. Once this is configured, any user that scans a QR code or submits a kit id associated with your account will be redirected to the registration url with two query string parameters included:

  • kitId - the Kit ID that the user submitted
  • orderNumber - the order number for the order made by the user

Integration

Embed the iframe into your web application as follows:

<iframe src="https://app.chronomics.com/register?publicToken={{PUBLIC_TOKEN}}&partnerCode={{PARTNER_CODE}}&kitId={{KIT_ID}}"></iframe>

📘

Setting query string parameters

Replace {{PUBLIC_TOKEN}} with a token generated for a user according to the following API specification

Replace {{PARTNER_CODE}} with the partner code provided to you by your Chronomics account manager. This will style the registration with the custom theme configured for your widget. The parameter can be omitted to use the default Chronomics theme

If a kitId was forwarded to you in the query string of a registration redirect request sent from Chronomics, this can be appended by setting the {{KIT_ID}} parameter to skip the first step where a user enters their Kit ID. If this parameter is omitted, the first step will be displayed.

Once the user completes the registration flow, a message will be published using window.postMessage(). In order to receive the published message, you need to add an event listener to the iframe's parent window. Upon receipt of the message the iframe can be closed and any appropriate further action can be taken.

window.addEventListener("message", (event) => {
  if (event.origin === "https://app.chronomics.com"){
    // Close the iframe
  }
}, false);