Storage SDK
JavaScript cloud save for PlayCanvas, three.js, and other browser JavaScript. For a Unity game, use the current VIVERSE Unity SDK for C#. Do not use this JavaScript SDK or a .jslib.
For a Unity game, use the current VIVERSE Unity SDK for C#. Do not use this JavaScript SDK or a .jslib for normal Unity authentication, cloud save, multiplayer, leaderboard, or avatar integration.
BEFORE GETTING STARTED: you must authenticate with VIVERSE, including App ID creation in VIVERSE Studio, before requesting Play SDK services.
Initialize the `storageClient` instance
Before using any Storage SDK features, you must initialize the client instance. This global reference ensures that the Storage SDK is available throughout your application. A Unity game uses CloudSaveClient in the VIVERSE Unity SDK. Do not add a .jslib for this sample.
globalThis.storageClient = new globalThis.viverse.storage();Cloud Save API
The cloudsave API must then be initialized individually.
globalThis.cloudSaveClient = await storageClient.newCloudSaveClient(appId);
Set Player Data
Call setPlayerData() with a specific key-value pair within the player's data.

Example code:
Get Player Data
Retrieves the value of a specific key from the player's data.

Example code:
Save
Saves the provided data as a new version.

Example code:
Get All
Retrieves all saved versions of saved data.

Example code:
Get Latest
Retrieves the most recent version of saved data.

Example code:
Delete
Deletes a specific version of the saved data.

Example code:
Last updated
Was this helpful?