WebView messages (Tracking endpoint)

Message types emitted by /pose_tracker/tracking and when they fire.

The Tracking endpoint emits structured messages during real-time tracking.

Use them to drive UI and business logic.

How messages are delivered

In a browser iframe, messages are sent via window.postMessage.

In mobile apps, they go through the WebView bridge.

Some integrations stringify the payload.

Handle both cases:

  • event.data is an object

  • event.data is a JSON string

Typical V3 flow (real-time)

  1. initialization messages while the model and camera load.

  2. posture messages until placement is good.

  3. Optional placement countdown (still posture messages).

  4. counter starts once tracking is active.

  5. Optional advanced outputs, depending on flags:

    • form_score

    • progression

    • recommendations

    • keypoints

    • angles

  6. Jump flows (when using jump_analysis / air_time_jump):

    • jump_calibration β†’ jump_started β†’ jump_height

    • optional jump_discarded

Message types (Tracking)

initialization (realtime)

Sent while the page loads and initializes.

Fields:

  • type (string) β€” always "initialization".

  • message (string) β€” human-readable status.

  • ready (boolean) β€” true only when tracking can start.

Example:

error (realtime)

Sent when the configuration or runtime fails.

Fields:

  • type (string) β€” always "error".

  • code (string) β€” machine-readable error code.

  • message (string) β€” human-readable description.

  • details (object, optional) β€” extra debug info.

Example:

Common codes you should handle:

  • missing_token β€” token is missing.

  • invalid_token β€” token is invalid or revoked.

  • invalid_exercise β€” exercise is missing or unknown.

  • developer_features_not_allowed β€” plan-gated flag used on Free plan.

  • webgl_unavailable β€” poseBackend=webgl requested but not available.

  • wasm_unavailable β€” poseBackend=wasm requested but cannot load.

  • camera_permission_denied β€” user denied camera access.

  • camera_not_found β€” no camera available.

  • jump_analysis_missing_height β€” userHeightCm required for jump_analysis.

posture (realtime placement)

Sent continuously during placement.

It tells you what the user should do to be β€œready”.

Fields:

  • type (string) β€” "posture".

  • message (string) β€” guidance text for the user.

  • direction (string) β€” placement direction hint. Example: "in-frame".

  • ready (boolean) β€” true when tracking can start.

  • requirements (array, optional) β€” unmet requirements.

  • countdownSecondsLeft (number, optional) β€” present when countdown is enabled.

Example:

counter (realtime)

Sent when exercise tracking is active.

For repetition exercises, it increments on each validated rep.

For duration exercises, it increments over time (seconds).

Fields:

  • type (string) β€” "counter".

  • current_count (number) β€” reps or seconds.

  • exercise (string, optional) β€” movement key.

Example:

form_score (realtime, optional)

Sent when form scoring is enabled for the exercise.

This is a compact β€œhow good is the current posture” signal.

Fields:

  • type (string) β€” "form_score".

  • score (number) β€” 0 to 100.

  • label (string, optional) β€” example: "good", "needs_work".

Example:

recommendations (realtime, plan-gated)

Sent when recommendations=true.

Fields:

  • type (string) β€” "recommendations".

  • data (array<string>) β€” feedback strings, ordered by priority.

Example:

progression (realtime, plan-gated)

Sent when progression=true.

This is usually a rep-phase progress signal.

Fields:

  • type (string) β€” "progression".

  • value (number) β€” 0 to 100.

Example:

keypoints (realtime, plan-gated)

Sent when keypoints=true.

Fields:

  • type (string) β€” "keypoints".

  • data (array<object>) β€” keypoints.

Keypoint object:

  • name (string) β€” landmark name.

  • x (number) β€” pixels.

  • y (number) β€” pixels.

  • score (number) β€” confidence 0 β†’ 1.

Example:

angles (realtime, plan-gated)

Sent when angles=true.

Fields:

  • type (string) β€” "angles".

  • data (object) β€” computed angles.

Example:

Jump messages (realtime, custom exercises)

These fire only for:

  • exercise=jump_analysis

  • exercise=air_time_jump

jump_calibration (jump_analysis only)

Sent during calibration.

jump_started

Sent once per detected jump.

jump_discarded

Sent when a jump attempt is detected but rejected.

Typical reasons are missing hips, occlusion, or unstable baseline.

jump_height

Sent during measurement and/or when a jump completes.

Payload differs slightly by jump type.

jump_summary

Sent for upload-video analyses.

It is not typically emitted in real-time mode.

Last updated