Gamestorageapi

GameStorageApi class

This class provides an API to store and retrieve data from the games.

Signature:

export declare class GameStorageApi 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the GameStorageApi class.

Methods

MethodModifiersDescription
get(key)Get a stored value by key from the game storage.
getAll()Get all stored values from the game storage.
getPlayerData()Get the current player data from the game storage.
set(key, data)Set a value by key in the game storage.
setPlayerData(data)Set the current player data in the game storage.
watch(key, cb)

This method provides realtime notifications when a value changes in the game storage.

The provided callback will be called with the initial value and then every time the value associated with the given key changes.