KinesteX

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.


ParameterTypeDefaultApplies toWhat it does internally
customWorkoutExercisesarrayCustom WorkoutThe 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):


PropertyTypeRequiredDescription
exerciseIdstringYesExercise document ID (from the Content API)
repsnumber or nullOne of reps/durationTarget repetitions (rep-based exercise)
durationnumber or nullOne of reps/durationDuration in seconds (timer-based exercise)
includeRestPeriodbooleanYesInsert a rest screen before this exercise
restDurationnumberYesRest length in seconds (rest is only inserted when > 0)
stage"warmup", "exercise", or "cooldown"NoColors 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.

Custom Workout Parameters
Swift example:
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)