Leaderboard
Configure the leaderboard. Applies to: Challenge (results are submitted on the challenge results screen) and the Leaderboard view.
| Parameter | Type | Default | Applies to | What it does internally |
| showLeaderboard | boolean | false (true in the SDK challenge views) | Challenge | Shows the leaderboard entry point on the challenge screen and, after a challenge with completed reps, opens the username modal that publishes the result. The Swift, Kotlin, Flutter, React Native and React challenge views send true unless you pass false |
| username | string | the user ID | Challenge, Leaderboard | Display name for leaderboard entries. Saved in the WebView (leaderboard_username) at verification so it persists across sessions. When absent, the userId is used |
| autoSubmitLeaderboard | boolean | false | Challenge | Publishes the challenge result without showing the submission modal, under the stored leaderboard_username (or the user ID), so pass username with it. Send a boolean by postMessage or inside ?data= |
How submission works: when a challenge with completed reps finishes, the result is always recorded. showLeaderboard controls whether the user is asked to publish it under a display name; autoSubmitLeaderboard: true skips the question and publishes at once. Use it when your app already manages display names.
Leaderboard Configuration
Swift example:
1kinestex.createChallengeView(
2 exercise: "Squats",
3 duration: 60,
4 showLeaderboard: true,
5 user: nil,
6 style: nil,
7 isLoading: $isLoading,
8 customParams: [
9 "username": "FitnessPro123",
10 "autoSubmitLeaderboard": true // skip the submit modal
11 ],
12 onMessageReceived: { message in /* ... */ }
13)