Skip to content

Reference

Global SDK object

The hosted script exposes a global workoutkit object.

Methods

workoutkit.init(baseUrl)

Initializes the SDK with your WorkoutKit base URL.

js
workoutkit.init('https://cloud.YourCompany.fizzup.com')

workoutkit.start(options)

Starts a workout session.

js
workoutkit.start({
  workoutId: '4RGZ7S46',
  soundpack: 'none',
  getAccessToken: async function () {
    return 'your-access-token'
  },
  onWorkoutQuit: function () {},
  onWorkoutSave: function (workoutData) {},
  onWorkoutEvent: function (action, payload) {},
})

Options

FieldRequiredDescription
workoutIdYesWorkoutKit workout identifier to launch
soundpackNoSound theme for the workout experience
getAccessTokenNoAsync callback returning a backend-issued access token
onWorkoutQuitNoCallback called when the user quits the workout
onWorkoutSaveNoCallback called when workout data is saved
onWorkoutEventNoGeneric callback receiving event name and payload

workoutkit.close()

Closes the WorkoutKit iframe.

js
workoutkit.close()

Supported soundpacks

Based on the current example flow:

  • none
  • zen
  • original
  • new
  • whistle