Appearance
Web SDK
TrainingKit Web SDK lets you launch a workout experience in a web page with a hosted SDK script and a trainingkit.start() call.
Use this section when you need to:
- load the SDK from the TrainingKit CDN
- initialize it with your TrainingKit 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
- Load the SDK script in your page.
- Call
trainingkit.init()with your TrainingKit base URL. - Call
trainingkit.start()with aworkoutIdand optional callbacks. - If your API perimeter requires JWT authentication, implement
getAccessToken()to fetch a short-lived token from your backend. - 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.
