Skip to main content
The hosted page sends JSON to the host. Browser embeds use window.parent.postMessage(JSON.stringify(data), "*"). iOS uses webkit.messageHandlers.iosListener. Android uses window.webViewCallback. Same type field in all three. SDK apps should prefer typed callbacks (onCounter, onKeypoints, …). onMessage on the SDK is this classic shape. Full SDK catalog: Events.

Transport

Real-time boot

Live camera is type: "initialization" with ready: true and message: "running".

Pose and exercise

Outside an exercise (pose-only URL), keypoints stream without extra flags. During an exercise, keypoints need keypoints=true + a paid plan.

Switch exercise in the same session

Host → PoseTracker, optional. If you never send it, nothing changes: the URL loads, places, counts and is billed exactly as before. While the tracking page is open (/pose_tracker/tracking with exercise= or userExercise=), the host can switch the exercise without reloading: What happens:
  • The camera and pose model keep running. Placement, the countdown (timer=) and the counter restart for the new exercise, like a first entry in the frame.
  • PoseTracker replies { type: "exercise_changed", exercise, userExercise } (userExercise is null for catalog ids), then the usual flow: posture, then counter from 0.
  • No new tracking call is billed. The whole page load counts as one call, so squat then plank then lunge in the same open iframe = 1 call.
  • Send exactly one of exercise or userExercise. Not available with reference= or in pose-only mode (no exercise in the URL).
  • Unknown id, both fields, or not allowed in this mode → { type: "error", error: "invalid_exercise", message }, and the current exercise keeps running. Sending the id already running is ignored.
In a React Native WebView (or a native WKWebView / Android WebView), run the post inside the page:
The session ends, and the next exercise counts as a new call, if you: close or unmount the iframe / WebView, reload it, change its src (any query param, including exercise=), navigate away, or the camera is stopped. To chain exercises for one call, keep the same page open and send set_exercise.

Jumps

jump_analysis and air_time_jump: jump_analysis requires userHeightCm. Missing → error jump_analysis_missing_height.

Upload extras

On upload tracking only: Upload init messages differ (loading video, % progress, Analysis completed).

Reference extras

When reference= is set, counter may include reference_score: { overallScore, nccScore, dtwScore, timingScore, distScore?, grade }. See Reference movement.
For LLMs: WebView events are JSON with type. Counter field is current_count. SDK typed callback uses count / formScore. To chain exercises in one billed call, post { type: "set_exercise", exercise } (or userExercise) to the open iframe; changing the iframe URL or closing it starts a new call. https://docs.posetracker.com/webview/messages
Last modified on October 16, 2026