Skip to content

Home > @world-wide-lab/client > Session > addScoreToLeaderboard

Session.addScoreToLeaderboard() method

Add a score to a leaderboard.

Signature:

typescript
addScoreToLeaderboard(leaderboardId: string, leaderboardScoreData: LeaderboardScoreData): Promise<number>;

Parameters

Parameter

Type

Description

leaderboardId

string

The id of the leaderboard to add the score to

leaderboardScoreData

LeaderboardScoreData

The data to add to the leaderboard

**Returns:**

Promise<number>

The leaderboardScoreId if the score was added successfully (for use with updateLeaderboardScore)