Custom Workout
Configure custom workout sequences. Applies to: Custom Workout only (createCustomWorkoutView, route /custom-workout) — the parameter is ignored on every other integration option. For the complete implementation guide, see Custom Workout integration.
| Parameter | Type | Default | Applies to | What it does internally |
| customWorkoutExercises | array | — | Custom Workout | The exercise sequence to build the workout from. After verification the SDK fetches each exercise, downloads videos, models, and audio, then posts all_resources_loaded when everything is ready |
Sequence object structure (per exercise):
| Property | Type | Required | Description |
| exerciseId | string | Yes | Exercise document ID (from the Content API) |
| reps | number or null | One of reps/duration | Target repetitions (rep-based exercise) |
| duration | number or null | One of reps/duration | Duration in seconds (timer-based exercise) |
| includeRestPeriod | boolean | Yes | Insert a rest screen before this exercise |
| restDuration | number | Yes | Rest length in seconds (rest is only inserted when > 0) |
| stage | "warmup", "exercise", or "cooldown" | No | Colors the rest-screen progress bar by workout stage |
Custom Workout Flow:
1. Pass customWorkoutExercises during initial verification.
2. Wait for the all_resources_loaded message (an error_occurred message is posted if the sequence is invalid or a resource fails).
3. Send workout_activity_action: "start" to begin — the SDK navigates into the standard workout flow automatically.
Note: restSpeeches / currentRestSpeech are Camera-component parameters (Camera Component); custom workouts generate their own rest audio. To simulate the workout with a video instead of the live camera, see Testing & Simulation.
1// Via customParams for additional settings
2let customExercises = [
3 WorkoutSequenceExercise(
4 exerciseId: "exercise-id-1",
5 reps: 15,
6 duration: nil,
7 includeRestPeriod: true,
8 restDuration: 20
9 )
10]
11
12kinestex.createCustomWorkoutView(
13 customWorkouts: customExercises, // direct
14 customParams: [
15 "shouldSendStats": true // optional: save the session on completion
16 ]
17)