Workout View
Personalized Workouts: Anytime, Anywhere.
- Tailored for All Levels: Workouts for strength, flexibility, or relaxation
- Time-Saving: Quick, efficient sessions with zero hassle
- Engaging: Keep users motivated with fresh, personalized routines
- Easy Integration: Add workouts seamlessly with minimal effort
You can find workouts in our workout library, or create your own workouts in our admin portal.
Rests: a rest is lengthened when the greeting and rest speech would run past it (never shortened, and not while sound is off). Send dynamicRestEnabled: false to keep the rest lengths set in the workout.
Real-time data: send includePoseData with "events" to receive the real-time motion events (reps, holds, form, presence) during the workout, and "poseLandmarks" / "worldLandmarks" for raw pose data. See Real-time motion parameters and Real-time motion events.
Events: workout_opened when the workout page loads, workout_started once per run (workout_resumed if the same run reopens), exercise_completed after each exercise and workout_overview on the results screen. Leaving the results screen posts workout_completed and plan_workout_exit_request, then shows the workout page again; back from the workout page posts exit_kinestex. See Workout events.
1kinestex.createWorkoutView(
2 workout: selectedWorkout, // workout name or ID
3 user: nil,
4 style: IStyle(style: "dark"), // "dark" or "light" theme
5 isLoading: $isLoading,
6 customParams: ["language": "en"],
7 onMessageReceived: { message in
8 switch message {
9 case .exit_kinestex(_):
10 showKinesteX = false // dismiss the view
11 default:
12 print("Received \(message)")
13 break
14 }
15 }
16)1import SwiftUI
2import KinesteXAIKit
3
4struct WorkoutIntegrationView: View {
5 @State private var showKinesteX = false
6 @State private var isLoading = false
7
8 // Initialize KinesteXAIKit
9 // Replace with your KinesteX credentials
10 let kinesteXKit = KinesteXAIKit(
11 apiKey: "YOUR API KEY",
12 companyName: "YOUR COMPANY NAME",
13 userId: "YOUR USER ID"
14 )
15
16 // Replace with the name or ID of the workout
17 let workoutName = "Fitness Lite"
18
19 var body: some View {
20 VStack {
21 Text("KinesteX Workout Integration")
22 .font(.title)
23 .padding()
24
25 Spacer()
26
27 Button(action: {
28 showKinesteX.toggle()
29 }) {
30 Text("Start \(workoutName) Workout")
31 .font(.title3)
32 .foregroundColor(.white)
33 .bold()
34 .padding()
35 .frame(maxWidth: .infinity)
36 .background(Color.green.cornerRadius(10))
37 .padding(.horizontal)
38 }
39 .padding()
40
41 Spacer()
42 }
43 .fullScreenCover(isPresented: $showKinesteX) {
44 kinesteXKit.createWorkoutView(
45 workout: workoutName,
46 user: nil,
47 style: IStyle(style: "dark"),
48 isLoading: $isLoading,
49 onMessageReceived: { message in
50 switch message {
51 case .exit_kinestex(_):
52 showKinesteX = false
53 default:
54 print("Message received: \(message)")
55 }
56 }
57 )
58 }
59 }
60}
61
62#Preview {
63 WorkoutIntegrationView()
64}



