Receive tandem walk progress, retry, and metrics from an embedded fall risk test.
Embed /fall-risk/{fallRiskResultId}/tandem-walk, usually using the
tandemWalkTestUrl returned by the fall risk create route:
<iframe
id="tandemWalkIframe"
title="Tandem walk test"
src="https://your-client.gofa.app/fall-risk/result-id/tandem-walk"
allow="camera; microphone"
></iframe>Messages use source: "gofa-tandem-walk" and a type/payload envelope.
type | Payload | Meaning |
|---|---|---|
STATE_TRANSITION | State and current metrics | The flow changed state. |
ASSESSMENT_STARTED | Current metrics | The timed assessment began. |
ASSESSMENT_ENDED | Final metrics | The assessment ended. |
RESULTS_SET | Final flow metrics | Final metrics were set. |
TIMER_COMPLETE | None | The flow timer completed. |
TIMER_ERROR | Error payload | The timer reported an error. |
EARLY_EXIT | None | The participant exited early. |
SHOULDER_TILT_UPDATE | Runtime tilt update | A live shoulder-tilt measurement was emitted. |
TANDEM_WALK_FAILED | Failure details when available | The flow recorded a failed walking attempt. |
The persisted API model prefers tandemWalk.rounds, with up to three rounds,
completed-step counts, retry/failure flags, durations, isPassed, and aggregate
step/duration fields. Event payloads can contain intermediate runtime metrics;
do not assume deprecated stepCount or walkingPath fields are present. Use
the authenticated result endpoint for the canonical stored shape.
const iframe = document.getElementById("tandemWalkIframe") as HTMLIFrameElement | null;
const expectedOrigin = "https://your-client.gofa.app";
window.addEventListener("message", (event) => {
const { source, type, payload } = event.data ?? {};
if (
event.origin !== expectedOrigin ||
event.source !== iframe?.contentWindow ||
source !== "gofa-tandem-walk"
) return;
switch (type) {
case "RESULTS_SET":
handleCompletedTest(payload);
break;
case "TANDEM_WALK_FAILED":
handleWalkFailure(payload);
break;
case "EARLY_EXIT":
handleEarlyExit();
break;
}
});The page posts with a wildcard target origin for compatibility. The receiver
must check event.origin, event.source, source, and the payload before
using camera-derived data. Do not log walking traces or complete result
payloads.