Skip to content

Web SDK

WorkoutKit Web SDK lets you launch a workout experience in a web page with a hosted SDK script and a workoutkit.start() call.

Use this section when you need to:

  • load the SDK from the WorkoutKit CDN
  • initialize it with your WorkoutKit base URL
  • start a workout from a workout identifier
  • provide a backend-issued access token when API authentication is enabled
  • react to workout lifecycle events in your application

Integration flow

  1. Load the SDK script in your page.
  2. Call workoutkit.init() with your WorkoutKit base URL.
  3. Call workoutkit.start() with a workoutId and optional callbacks.
  4. If your API perimeter requires JWT authentication, implement getAccessToken() to fetch a short-lived token from your backend.
  5. Listen to workout events to handle quit, save, or custom tracking behavior.

In this section

Security note

If you use API authentication, keep JWT signing and private keys on your backend only. The web client should only request a token from your server and pass it to the SDK.