Embedding Hireflix Interviews in your software
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.
- Use an iFrame to embed a Hireflix Interview Link
<iframe src="the-hireflix-interview-link-goes-here" allow="camera;microphone" />
allow="camera;microphone" so users can use their camera and microphone in order to take the interview
- 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:
An event always has the following format:
"type": "event-type", // interview.loaded, interview.finished, etc
"description": "the event description"
This is the list of events currently supported:
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
This event is fired when the user finishes the interview and the finish screen is presented