App storage is where you keep the app data inside Spaces.

How to Store Data in App Storage



The App.setStorage function is a data storage function complementing existing app data storage methods.

Not recommended = string;;

If the app is running on several maps in the same Space, the above method may cause issues such as data being overwritten.

How to Read the App Storage Value


The App.getStorage function helps synchronize the app data so that it can have the same data by checking if the same app is running on another map within the same Space.

As the App.getStorage function is an asynchronous function, synchronization cannot be guaranteed if you add a code that uses on the very next line of this function.

App Storage Example

Install the example code below as a sidebar app and press Q on another map in the same Space to see if the "count" value is synchronized.

	if( == null){
		App.setStorage(JSON.stringify({count: 0}))
// // Activates function when q is pressed
	// Updates and executes a callback function
	App.getStorage(function () {
		let appStorage = JSON.parse(;
		appStorage.count += 1;
		App.sayToAll(`count: ${appStorage.count}`)
		// Uses App.setStorage to save any changes
	// Synchronization not guaranteed if you add a code that uses on the very next line of the App.getStorage function.

Last updated