KinesteX v2.06.0: ✨ NEW CUSTOM WORKOUT INTEGRATION OPTION
This update introduces support for defining custom sequence of exercises and displaying the workout flow of KinesteX, allowing you to customize and handle the onboarding process, currently supporting only our React Native package version 1.2.5, all other packages will support it later next week as well!
Watch this update walkthrough here:
Overview
The Custom Workout feature allows you to create and execute personalized workout sequences with custom exercises, repetitions, durations, and rest periods. This feature integrates with the KinesteX SDK via postMessage communication.
How Custom Workouts Work
1. Initial Setup
When integrating custom workouts, you need to:
Initialize the KinesteX SDK with
CUSTOM_WORKOUTas integrationOptionSend initial configuration including your custom workout exercises
Wait for the ready signal from the SDK
Send the start command to begin the workout
Sending Custom Workout Data via PostMessage
Step 1: Initial Configuration
When initializing the SDK, send your custom workout exercises in the customWorkoutExercises field:
export interface WorkoutSequenceExercise {
exerciseId: string;
reps: number | null;
duration: number | null;
includeRestPeriod: boolean;
restDuration: number;
}
Example usage:
const customWorkoutExercises: WorkoutSequenceExercise[] = [
{
exerciseId: "jz73VFlUyZ9nyd64OjRb", // exercise id from kinestex api or admin panel
reps: 15, // reps for the exercise
duration: null, // duration for the exercise (null if not applicable and person has unlimited time to complete specified number of reps)
includeRestPeriod: true, // include rest period before the exercise
restDuration: 20, // rest duration in seconds before the exercise
},
{
exerciseId: "ZVMeLsaXQ9Tzr5JYXg29",
reps: 10,
duration: 30,
includeRestPeriod: true,
restDuration: 15,
},
// duplicate of the exercise above to create a set
{
exerciseId: "ZVMeLsaXQ9Tzr5JYXg29",
reps: 10,
duration: 30,
includeRestPeriod: true,
restDuration: 15,
},
{
exerciseId: "gJGOiZhCvJrhEP7sTy78",
reps: 20,
duration: null,
includeRestPeriod: false,
restDuration: 0,
},
];Step 2: Listen for Ready Signal
After sending the initial configuration, wait for the SDK to signal that it's ready and all resources are loaded:
const handleMessage = (type: string, data: { [key: string]: any }) => {
switch (type) {
...
case "all_resources_loaded":
console.log("All resources loaded:", data);
// display KinesteX view now
setAllResourcesLoaded(true);
// send an action to start the workout flow
kinestexSDKRef.current?.sendAction("workout_activity_action", "start");
break;
}
};Exercise Configuration
WorkoutExerciseSequence Object
Each exercise in your custom workout is defined by the following properties:
Note: At least one of reps or duration must be non-null. You can also specify both if the exercise should track both metrics.