Session & Data Saving
Control session saving and data upload behavior. Applies to: any flow ending on the statistics screen (Workout player and Challenge completions).
| Parameter | Type | Default | Applies to | What it does internally |
| shouldSendStats | boolean | false (true for AI Trainer) | Workout player | When enabled, the completed session is automatically saved to the KinesteX backend — per-exercise stats, accuracy scores, calories, and the motion recording (used for session replay). Saved sessions are retrievable via the Workout Sessions API. For AI Trainer launches the default is true so the chat can show the completed-workout card |
Messages posted to the host during saving:
workout_session_saved— the session document was stored (includes the session ID and scores)motion_upload_progress— motion-recording upload progresssession_save_complete— everything (session + motion data) finished uploadingmotion_upload_error— the motion upload failed or timed out
Offline behavior: if saving fails (e.g. no connectivity), the result is queued locally and retried automatically on the next launch — the corresponding messages fire when the retry succeeds.
Note: independent of this flag, the statistics screen always posts the workout_overview / exercise_overview summary messages to the host. shouldSendStats only controls backend persistence. If motionDataEnabled: false was passed, the saved session will have no replay data.
Session Saving Configuration
Swift example:
1// Via customParams
2kinestex.createWorkoutView(
3 workout: "Full Body Burn",
4 customParams: [
5 "shouldSendStats": true
6 ]
7)