BEFORE GETTING STARTED: you must before requesting leaderboard services.
Leaderboard Setup in VIVERSE Studio
Before integrating the Leaderboard SDK, you must first configure the leaderboard metadata settings for your content
in VIVERSE Studio.
Go to the Upload section in the sidebar to open the "Manage Content" page in VIVERSE Studio.
Click "Upload Content" for the world you want to edit, then navigate to the SDK Settings tab.
In the Leaderboard Configuration section, define the necessary leaderboard parameters. This configuration is required to enable proper interaction between your content and the leaderboard
system.
Game Dashboard Client Setup
To then make use of your VIVERSE Leaderboard, you must instantiate the gameDashboardClientafter authentication.
// If the user is logged in, get the token; if not, return `undefined`
const accessToken = await globalThis.viverseClient.getToken();
// initialize game dashboard client instance
globalThis.gameDashboardClient = new globalThis.viverse.gameDashboard({
baseURL: 'https://www.viveport.com/',
communityBaseURL: 'https://www.viverse.com/',
token: { accessToken }
});
Then call uploadLeaderboardScore() to change leaderboard data: