Embedding Hireflix Interviews in your software

Updated by Daniel Limia Aspas

If you're integrating Hireflix into your own software and want candidates to never leave the screen to take a Hireflix Interview and have a smooth experience, embedding can be ideal to accomplish this.

Using an iFrame, you can embed a Hireflix Interview in your HTML5 document in an easy and seamless way.

We've prepared a demo with code, that showcases how you can embed a Hireflix Interview in your software and listen for interview events as they come.

  1. Use an iFrame to embed a Hireflix Interview Link
<iframe src="the-hireflix-interview-link-goes-here" allow="camera;microphone" />
It's very important that you set allow="camera;microphone" so users can use their camera and microphone in order to take the interview
  1. Listen to postMessage events sent by the Hireflix iFrame

Hireflix uses the postMessage API to send events that you can then receive.

To listen for events is as simple as doing:

window.addEventListener('message', onEventReceived);

An event always has the following format:

{
"type": "event-type", // interview.loaded, interview.finished, etc
"payload": {
...
},
"description": "the event description"
}

This is the list of events currently supported:

Type

Payload

Description

interview.loaded

The payload is a JSON object containing the interview ID and other metadata

This event is fired when the interview is loaded and the first screen is presented

interview.finished

This event is fired when the user finishes the interview and the finish screen is presented


How did we do?


Powered by HelpDocs (opens in a new tab)