Uniplay

Time played#

Each game counts how long the player has spent in it, across every save, and the Hub shows the total in Game details. It is kept apart from saves: deleting a save never takes its time away.

Storage: localStorage#

Key: uniplay:playtime:<game id>. Value: JSON.

{ "v": 1, "seconds": 15120, "lastPlayed": 1790000000000 }

With the SDK#

The SDK does all of this on its own once the game creates its Uniplay instance (uniplay.playtime.seconds reads the total). Each game writes only its own key. The Hub only reads it, and never deletes it with a save.

const uniplay = new Uniplay({ game: 'heated-heist' }); // counting starts here
console.log(uniplay.playtime.seconds);