SDK Demo Configurations

Demo-oriented setup pages for assessment, workout, and exercise flows across SMKit and SMKitUI. These examples follow the public demo apps and keep branded SMKitUI flows separate from custom no-UI SMKit session flows.

Kit
Page

Configuration Builder

Choose a demo flow, enable SDK features, select exercises, and export a reusable integration file.

Feature options
Exercise shortlist

SMKitUI / Flutter

Flutter SMKitUI Demo Configuration

The Flutter branded demo configures the plugin, applies shared UI settings, then launches built-in assessments, custom workouts, and exercise definitions through SMKitUI models.

Assessment Demo Configuration

Use `startAssessment` for built-in assessment templates. Use `startCustomizedAssessment` when the demo builds its own `SMKitWorkout` with assessment exercises and scoring.

  • Choose `AssessmentTypes.fitness`, `strength`, `cardio`, or `custom`.
  • Pass user data when available; otherwise the UI can collect missing details.
  • Apply shared demo settings before launching the flow.
await settings.applyTo(smkit); // Applies demo settings such as colors, audio, and calibration behavior.
smkit.startAssessment( // Starts a branded built-in assessment flow.
  type: AssessmentTypes.fitness, // Selects the built-in assessment template.
  userData: { // Supplies optional user data so the flow does not need to ask.
    'gender': 'Male', // Sets the demo gender value.
    'birthday': DateTime(1990, 1, 1).millisecondsSinceEpoch, // Sends birthday as milliseconds.
  }, // Finishes user data.
  showSummary: true, // Shows the branded summary screen at the end.
  onHandle: handleStatus, // Receives status, result, and error callbacks from native code.
); // Launches the assessment.

Workout Demo Configuration

The demo creates an `SMKitWorkout`, fills it with `SMKitExercise` objects, applies settings, and starts the branded workout shell.

  • Workout-level fields define name, intro, soundtrack, exercises, and closure.
  • Each exercise carries detector, duration, instruction asset, UI elements, and options.
  • Use the same start path for demo-built workouts and production workout definitions.
final workout = await getDemoWorkout(); // Builds the demo SMKitWorkout from the local workout builder.
await settings.applyTo(smkit); // Applies demo-wide SDK/UI settings before presentation.
smkit.startCustomizedWorkout( // Starts the branded custom workout flow.
  workout: workout, // Passes the configured workout model.
  onHandle: handleStatus, // Receives workout lifecycle and summary callbacks.
); // Presents SMKitUI.

Exercise Demo Configuration

Exercise configuration is the unit that powers both custom assessment and custom workout builders.

  • Use rep-oriented UI for dynamic movements and timer/holding-position UI for static movements.
  • Use floor or elevated phone placement according to the exercise framing.
  • Attach per-exercise options for countdown, guidance, adaptive ROM, sounds, or stretch-set behavior.
final exercise = SMKitExercise( // Creates one branded exercise item.
  name: 'Squat Regular', // Sets the visible exercise name.
  detector: 'SquatRegular', // Selects the movement detector.
  totalSeconds: 30, // Sets the exercise duration.
  videoInstruction: 'SquatRegularInstructionVideo', // Selects the instruction video asset key.
  uiElements: [SMKitUIElement.repsCounter, SMKitUIElement.timer], // Shows reps and timer.
  phonePosition: SMKitPhonePosition.floor, // Requests floor phone placement.
  shortIntro: true, // Uses the shorter intro flow when supported.
); // Finishes the exercise configuration.

SMKitUI / React Native

React Native SMKitUI Demo Configuration

The React Native branded demo uses `@sency/react-native-smkit-ui` and `SMWorkoutLibrary` models for built-in assessments, custom workouts, and assessment-style exercise scoring.

Assessment Demo Configuration

Built-in assessments call `startAssessment`. Custom assessments build `SMAssessmentExercise` instances with `SMScoringParams` and launch them as an assessment model.

  • The demo exposes Fitness, Cardio, Strength, and Custom assessment options.
  • `showSummary` controls the summary screen.
  • Settings are applied before the launch call.
await applyDemoSettings(settings); // Applies the demo's theme, audio, and runtime settings.
const result = await startAssessment( // Starts a built-in branded assessment.
  SMWorkoutLibrary.AssessmentTypes.Fitness, // Selects the assessment type.
  true, // Shows the summary screen.
  null, // Lets the SDK collect user data if needed.
  false, // Does not force user data collection.
  '' // Uses no custom assessment id.
); // Waits for the result payload.
showSummaryModal(result.summary); // Displays the returned summary in the demo.

Workout Demo Configuration

The demo builds a `SMWorkout` from `SMExercise` items and starts it with `startCustomWorkout`.

  • Exercise arrays define sequence, UI elements, detector names, and per-exercise options.
  • Workout ids and names are app-owned.
  • The same result path returns workout summaries or errors.
const workout = new SMWorkoutLibrary.SMWorkout( // Creates the custom workout model.
  'example-workout', // Sets a stable workout id.
  'Example Custom Workout', // Sets the visible workout name.
  null, // Uses no workout intro sound.
  null, // Uses no soundtrack.
  exercises, // Supplies the ordered SMExercise list.
  null, // Uses no workout closure sound.
  null, // Uses default body calibration copy.
  null, // Uses default get-in-frame copy.
); // Finishes workout creation.
const result = await startCustomWorkout( // Starts the branded workout.
  workout // Passes the configured workout.
); // Waits for the native result.

Exercise Demo Configuration

React Native exercises are constructed with positional arguments plus an options object for newer per-exercise behavior.

  • Use `UIElement.RepsCounter`, `Timer`, `GaugeOfMotion`, and related UI elements.
  • Use options for short intro, countdown, adaptive ROM, guidance, stretch sets, and phone position.
  • Use `SMAssessmentExercise` when scoring params and summary labels are required.
const exercise = new SMWorkoutLibrary.SMExercise( // Creates one exercise for a workout.
  'Squat Regular', // Sets the visible exercise name.
  30, // Sets total exercise seconds.
  'SquatRegularInstructionVideo', // Selects the instruction video key.
  null, // Uses no exercise intro audio.
  [SMWorkoutLibrary.UIElement.RepsCounter, SMWorkoutLibrary.UIElement.Timer], // Shows reps and timer.
  'SquatRegular', // Selects the detector.
  null, // Uses no exercise closure audio.
  null, // Uses no scoring params for workout mode.
  { // Starts per-exercise options.
    shortIntro: true, // Uses the short intro.
    playPreExerciseCountdown: true, // Plays a countdown before detection starts.
    adaptiveRomFeedbackEnabled: true, // Enables adaptive ROM feedback.
    adaptiveRomWarmupReps: 2, // Uses two reps for ROM warmup.
  }, // Finishes per-exercise options.
); // Finishes exercise creation.

SMKitUI / Android

Android SMKitUI Demo Configuration

The Android branded demo configures `SMKitUI`, applies settings, then starts built-in assessments and custom workouts with Kotlin data models.

Assessment Demo Configuration

Use `startAssessment` with an assessment type, listener, user data, and phone calibration behavior.

  • The demo starts the Fitness assessment from the main screen.
  • `SMKitUIWorkoutListener` receives errors, summary, exit, and per-exercise data.
  • Phone calibration can be shown before the assessment flow.
applyBasicSettingsToSdk() // Applies demo settings before launching the flow.
	smKitUI?.startAssessment( // Starts the built-in assessment.
  assessmentType = Fitness, // Selects the Fitness assessment type.
  listener = this, // Receives workout and assessment callbacks.
  userData = UserData(14, Gender.Male), // Supplies demo user data.
	  showSummary = true, // Shows the summary screen.
  showPhoneCalibration = true // Shows phone placement calibration before the flow.
) // Launches SMKitUI.

Workout Demo Configuration

Custom workouts are `SMWorkout` objects with id, name, audio keys, exercise lists, and optional continuation behavior.

  • Use `startCustomizedWorkout` for demo-created workout sequences.
  • Pass `showPhoneCalibration = true` when the flow should guide phone placement.
  • Exercise lists come from the demo view model.
val workout = SMWorkout( // Creates the custom workout model.
  id = "50", // Sets the demo workout id.
  name = "demo workout", // Sets the visible workout name.
  workoutIntro = "workoutIntro", // Selects the workout intro sound key.
  soundtrack = "soundtrack_7", // Selects the soundtrack key.
  exercises = viewModel.workoutExercises(), // Supplies ordered exercise definitions.
  workoutClosure = "workoutClosure", // Selects the closure sound key.
  getInFrame = "getInFrame", // Selects get-in-frame copy/audio key.
  bodycalFinished = "bodycalFinished" // Selects body calibration completion key.
) // Finishes workout configuration.
smKitUI?.startCustomizedWorkout( // Starts the branded workout.
  workout, // Passes the configured workout.
	  listener = this, // Receives lifecycle callbacks.
  showPhoneCalibration = true // Shows phone calibration before the workout.
) // Launches the workout.

Exercise Demo Configuration

Android exercise definitions are Kotlin `SMExercise` values. The demo uses view-model helpers to build normal workout exercises and SDK-feature-specific exercise variants.

  • Dynamic exercises usually show reps, timer, and gauge UI.
  • Static exercises usually show timer and holding-position UI.
  • Per-exercise options can include adaptive ROM, countdown, milestone sounds, and phone placement.
val exercise = SMExercise( // Creates one workout exercise.
  name = "Squat Regular", // Sets the visible exercise name.
  totalSeconds = 30, // Sets exercise duration.
  videoInstruction = "SquatRegularInstructionVideo", // Selects instruction asset key.
  exerciseIntro = null, // Uses no exercise intro audio.
  uiElements = setOf(UiElement.repsCounter, UiElement.timer, UiElement.gaugeOfMotion), // Shows workout UI.
  detector = "SquatRegular", // Selects the movement detector.
  exerciseClosure = null, // Uses no exercise closure audio.
  scoringParams = null, // Keeps workout mode unscored.
  adaptiveRomFeedbackEnabled = true, // Enables adaptive ROM feedback.
  adaptiveRomWarmupReps = 2 // Uses two warmup reps for ROM calibration.
) // Finishes exercise creation.

SMKitUI / iOS

iOS SMKitUI Demo Configuration

The iOS branded demo uses UIKit controllers to choose built-in assessments, build custom assessments, build workouts, and launch `SMKitUIModel` flows.

Assessment Demo Configuration

The demo presents a built-in assessment picker, applies settings, and starts the chosen assessment type.

  • Use `AssessmentTypes` for built-in flows.
  • Pass `UserData` when available.
  • Use the SDK spelling `startAssessmet` where required by the iOS API.
DemoSettingsStore.shared.applyToSDK() // Applies demo settings before presenting SMKitUI.
let userData = UserData(gender: .Female, birthday: Date()) // Supplies optional user data.
try SMKitUIModel.startAssessmet( // Starts a built-in assessment using the iOS API spelling.
  viewController: viewController, // Presents from the current controller.
  type: AssessmentTypes.Fitness, // Selects the built-in assessment type.
  userData: userData, // Passes optional user profile data.
  delegate: self, // Receives assessment/workout callbacks.
  onFailure: { error in print(error.localizedDescription) }, // Handles launch errors.
  showPhoneCalibration: DemoSettingsStore.shared.showPhoneCalibration // Controls phone calibration.
) // Launches the assessment.

Workout Demo Configuration

The iOS demo creates `SMWorkout`, optionally attaches continuation exercises, and starts it with `startWorkout`.

  • Workout fields cover id, name, intro, soundtrack, exercise list, and closure.
  • Continuation is optional and only attached when the exercise list is non-empty.
  • The delegate receives finish, exit, summary, and per-exercise callbacks.
let workout = SMWorkout( // Creates the branded workout model.
  id: "", // Sets the workout id.
  name: "Demo Workout", // Sets the visible workout name.
  workoutIntro: nil, // Uses no workout intro audio.
  soundtrack: nil, // Uses no soundtrack.
  exercises: exercises, // Supplies the ordered SMExercise list.
  workoutClosure: nil, // Uses no workout closure audio.
  continuation: continuation // Attaches optional continuation exercises.
) // Finishes workout creation.
try SMKitUIModel.startWorkout( // Starts the branded workout.
  viewController: viewController, // Presents from the current controller.
  workout: workout, // Passes the configured workout.
  delegate: self, // Receives lifecycle callbacks.
  showPhoneCalibration: DemoSettingsStore.shared.showPhoneCalibration // Controls calibration.
) // Launches SMKitUI.

Exercise Demo Configuration

The iOS demo creates `SMExercise` from catalog entries, then sets extra properties such as guidance mode before starting a one-exercise workout.

  • Use `ExerciseCatalog` to derive display name and default duration.
  • Use instruction video keys or bundled file paths.
  • Set `guidanceMode`, phone position, wide-angle, or other properties before adding the exercise to a workout.
var exercise = SMExercise( // Creates one branded exercise.
  name: ExerciseCatalog.displayName(for: detector), // Sets display name from the demo catalog.
  exerciseIntro: nil, // Uses no exercise intro audio.
  totalSeconds: max(10, ExerciseCatalog.entry(for: detector).defaultDuration), // Sets duration.
  videoInstruction: "\(detector)InstructionVideo", // Selects instruction video key.
  uiElements: nil, // Lets the SDK choose default UI elements.
  detector: detector, // Selects the movement detector.
  exerciseClosure: nil // Uses no closure audio.
) // Finishes exercise creation.
exercise.guidanceMode = true // Enables guidance for the exercise flow.

SMKit / Flutter

Flutter SMKit Demo Configuration

The Flutter no-UI demo owns the screens and uses SMKit for camera session, detection, calibration, events, and summaries. Assessment and workout demos are app-level compositions over the same session and exercise APIs.

Assessment Demo Configuration

SMKit has no branded built-in assessment launcher. The demo assessment button starts an app-owned assessment flow that runs one or more detections and computes the result in the host UI.

  • Configure SMKit first.
  • Start a session and run the assessment exercise sequence.
  • Use detection data and stop summaries for scoring and result UI.
await SmKit.startSession( // Starts the camera session for the app-owned assessment.
  viewId: viewId, // Attaches SMKit to the Flutter camera preview.
  settings: const SessionSettings(phonePositionType: SmKitPhonePosition.floor), // Uses floor framing.
); // Waits for the session to start.
await SmKit.startDetection( // Starts the assessment exercise detector.
  exercise: 'SquatRegular', // Selects the movement for this assessment step.
); // Begins live detection.
final result = await SmKit.stopDetection(recordExercise: true); // Records the step result.
final summary = await SmKit.stopSession(); // Ends the assessment session and returns summary data.

Workout Demo Configuration

Workout mode is also host-owned in SMKit: define an ordered exercise plan in Flutter, then start and stop detectors in sequence.

  • The app controls exercise cards, timers, transitions, and rest UI.
  • SMKit provides camera, feedback, rep data, and exercise/session summaries.
  • Use `recordExercise: true` for exercises that should appear in the session summary.
final plan = ['SquatRegular', 'HighKnees']; // Defines the app-owned workout sequence.
await SmKit.startSession(viewId: viewId); // Starts the camera session once for the workout.
for (final detector in plan) { // Runs each exercise in order.
  await SmKit.startDetection(exercise: detector); // Starts the current detector.
  await Future.delayed(const Duration(seconds: 30)); // Lets the host workout timer run.
  await SmKit.stopDetection(recordExercise: true); // Saves the exercise result.
} // Finishes the workout loop.
final workoutSummary = await SmKit.stopSession(); // Returns the recorded workout summary.

Exercise Demo Configuration

The core exercise page configures session options and starts one detector. The host app renders all exercise UI.

  • Use detector names from the movement catalog.
  • Subscribe to session events for detection, position, phone calibration, and body calibration updates.
  • Use adaptive ROM and guidance options on `startDetection` where supported.
SmKit.sessionEventStream.listen((event) { // Subscribes to native SDK events.
  print(event.type.toString()); // Routes detection or calibration events into the host UI.
}); // Starts the subscription.
await SmKit.startDetection( // Starts one exercise detector.
  exercise: 'SquatRegular', // Selects the movement detector.
  adaptiveRomFeedbackEnabled: true, // Enables adaptive ROM feedback.
  adaptiveRomWarmupReps: 2, // Uses two reps to set the ROM baseline.
); // Begins exercise detection.

SMKit / React Native

React Native SMKit Demo Configuration

The React Native no-UI demo uses `SmkitCameraView`, imperative ref methods, and app-owned state to run sessions, exercise detection, and summary handling.

Assessment Demo Configuration

SMKit React Native does not launch branded assessments. The demo uses an app-owned assessment screen that starts a session, runs detectors, and computes results from callbacks.

  • Request Android camera permission before mounting/starting the session.
  • Use `onDetectionData` for live scoring and `onDetectionStopped` for exercise summaries.
  • Use the native skeleton overlay on Android when the UI needs low-latency skeleton rendering.
const hasPermission = await ensureAndroidCameraPermission(); // Requests Android camera permission when needed.
if (!hasPermission) return; // Stops if the user denied camera access.
setSessionStarted(true); // Mounts the SmkitCameraView in the app UI.
cameraRef.current?.startSession({ // Starts the native SMKit session.
  phonePosition: 'Floor', // Uses floor phone placement.
  userHeight: 175, // Supplies user height for configured exercises.
}); // Begins camera processing.
cameraRef.current?.startDetection('SquatRegular'); // Starts the assessment exercise detector.

Workout Demo Configuration

The workout demo is a host-controlled sequence over one `SmkitCameraView` session.

  • The app owns exercise selection, timers, transitions, and result presentation.
  • Use `startSession` once, then `startDetection` for each exercise.
  • Use `stopDetection({ recordExercise: true })` to add exercise results to the session summary where supported.
const workout = ['SquatRegular', 'HighKnees']; // Defines the app-owned workout plan.
cameraRef.current?.startSession({ phonePosition: 'Floor' }); // Starts the camera session.
for (const exercise of workout) { // Iterates through the workout exercises.
  cameraRef.current?.startDetection(exercise); // Starts the selected detector.
  await waitForExerciseTimer(); // Lets the host timer or target logic run.
  cameraRef.current?.stopDetection({ recordExercise: true }); // Records the exercise result.
} // Finishes all exercises.
cameraRef.current?.stopSession(); // Ends the session and triggers summary callbacks.

Exercise Demo Configuration

The React Native exercise demo configures the camera view props and uses the ref to start detection.

  • `onDetectionData` receives rep, feedback, ROM, and score data.
  • `onPositionData` can render a JS skeleton; Android can instead use `showNativeSkeletonOverlay`.
  • Use `positionDataFps` and `detectionDataFps` to manage bridge traffic.
<SmkitCameraView // Renders the native SMKit camera view.
  ref={cameraRef} // Exposes imperative session and detection methods.
  authKey={API_KEY} // Supplies the SDK auth key.
  exercise={selectedExercise} // Stores the currently selected detector.
  phonePosition="Floor" // Uses floor placement.
  showNativeSkeletonOverlay={Platform.OS === 'android'} // Uses native Android skeleton rendering.
  onDetectionData={handleDetectionData} // Receives live movement data.
  onDetectionStopped={handleDetectionStopped} // Receives exercise summary data.
/> // Finishes the camera view.
cameraRef.current?.startDetection('SquatRegular'); // Starts the selected exercise.

SMKit / Android

Android SMKit Demo Configuration

The Android no-UI demo owns the fragments and uses a view model around native SMKit to start sessions, run detectors, and present assessment/workout screens.

Assessment Demo Configuration

The demo assessment fragment starts a camera session and runs an app-defined sequence through the shared activity view model.

  • SMKit no-UI does not present branded assessment screens.
  • The app owns the assessment list, score labels, and result screen.
  • SMKit supplies live detection data and exercise/session summaries.
viewModel.startSession( // Starts the native camera session.
  viewLifecycleOwner, // Binds camera work to the fragment lifecycle.
  binding.previewView.surfaceProvider // Supplies the CameraX preview surface.
) // Begins frame processing.
viewModel.startDetection( // Starts the assessment movement.
  exerciseName = "SquatRegular", // Selects the detector.
  guidanceMode = null // Lets SMKit choose default guidance behavior.
) // Begins assessment detection.

Workout Demo Configuration

The workout fragment follows the same session/detection model but iterates through a host-defined workout sequence.

  • Use a single session for the workout when possible.
  • Switch or stop/start detectors between exercises.
  • Call `stopSession` when the app-owned workout is complete.
val workout = listOf("SquatRegular", "HighKnees") // Defines the app-owned workout sequence.
viewModel.startSession(viewLifecycleOwner, binding.previewView.surfaceProvider) // Starts camera preview.
workout.forEach { exerciseName -> // Runs each detector in order.
  viewModel.startDetection(exerciseName, guidanceMode = null) // Starts the current exercise.
  waitForTimerOrTarget() // Lets the host workout logic decide when to stop.
  viewModel.stopDetection(recordExercise = true) // Saves the exercise result.
} // Finishes the sequence.
viewModel.stopSession() // Ends the workout session.

Exercise Demo Configuration

Exercise configuration is the detector name plus native session options and optional guidance mode.

  • Use `startDetection(exerciseName, guidanceMode)` through the SDK/view model.
  • Use listener callbacks for detection data, position data, errors, and camera readiness.
  • Use `PoseModelChoice.AdaptiveChoice` during configure when following the current demo setup.
smKit.startDetection( // Starts one Android detector.
  exercise = "SquatRegular", // Selects the movement detector.
  guidanceMode = null // Lets default guidance policy decide.
) // Begins exercise detection.
smKit.smKitSessionListener(sessionListener) // Receives movement and pose callbacks.

SMKit / iOS

iOS SMKit Demo Configuration

The iOS no-UI demo owns its SwiftUI/UIKit screens and uses `SMKitFlowManager` for camera session, detection, and summary data.

Assessment Demo Configuration

The iOS SMKit demo includes an app-owned assessment controller. It starts an SMKit session, runs the current assessment exercise, and uses returned exercise data for the assessment UI.

  • SMKit does not present branded assessment screens.
  • The app controls assessment steps, scoring, and navigation.
  • Use `SMKitSessionSettings` to configure phone placement, camera, and user options.
let settings = SMKitSessionSettings( // Creates session settings for the assessment.
  phonePosition: .Floor, // Uses floor phone placement.
  autoStartCamera: true // Starts camera capture when the session starts.
) // Finishes session settings.
flowManager?.startSession(sessionSettings: settings) { result in // Starts camera/model session.
  if case .success = result { // Continues only after session startup succeeds.
    try? self.flowManager?.startDetection(exercise: currentExercise) // Starts the assessment exercise.
  } // Finishes success handling.
} // Finishes session start.

Workout Demo Configuration

Workout configuration is host-owned: define the movement sequence in the app, run each detector, record results, then stop the session.

  • The app owns workout UI, timers, transitions, and rest states.
  • SMKit owns camera processing and movement feedback.
  • Use `recordExercise: true` when an exercise should be included in session data.
let workout = ["SquatRegular", "HighKnees"] // Defines the app-owned workout sequence.
flowManager?.startSession(sessionSettings: SMKitSessionSettings()) { result in // Starts the session.
  guard case .success = result else { return } // Stops if camera/model startup failed.
  try? self.flowManager?.startDetection(exercise: workout[0]) // Starts the first detector.
} // Finishes session start.
let exerciseInfo = try flowManager?.stopDetection(recordExercise: true) // Records one exercise result.
flowManager?.stopSession { result in print(result) } // Ends the workout and reads session data.

Exercise Demo Configuration

The exercise demo uses `SMKitFlowManager` with session settings and a detector name.

  • Use detector names from the movement catalog.
  • Implement `SMKitSessionDelegate` for camera, detection, position, and error callbacks.
  • Keep camera settings aligned with the selected detector and phone placement.
flowManager = SMKitFlowManager(delegate: self) // Creates the SMKit flow manager with callbacks.
let settings = SMKitSessionSettings(autoStartCamera: true) // Creates an exercise session that starts camera capture.
flowManager?.startSession(sessionSettings: settings) { result in // Starts camera capture.
  if case .success = result { // Runs after the session is ready.
    try? self.flowManager?.startDetection(exercise: "SquatRegular") // Starts exercise detection.
  } // Finishes success handling.
} // Finishes session startup.