Skip to content

Storage API (ex.storage)

Bibliofile edited this page Oct 18, 2019 · 2 revisions

This is out of date. See here for up to date docs.

To make it easier to save and retrieve data between launches, extension.storage.<function> exists. The local parameter determines whether or not the stored item is saved with the world ID as part of the name.

storage.clearNamespace(namespace)

Removes all storage items that start with namespace.

storage.getString(key, fallback, local = true)

Gets a string from localStorage and returns it if it exists. Otherwise, it returns the passed fallback.

storage.getObject(key, fallback, local = true)

Returns a parsed object from localStorage if it exists. Otherwise, it returns the fallback.

storage.set(key, data, local = true)

Saves the passed data to localStorage, stringifying it before saving if necessary.

Clone this wiki locally