Class: StorageKey

rune.data.StorageKey()

Requires an explicit developer.app identifier matching Application configuration. IDs are preserved verbatim and never derived from page location. Each game must supply its own unique ID; this helper validates format, not uniqueness.

Constructor

new StorageKey()

Provides shared application identifiers for local storage handlers.
Source:

Methods

(static) create(id, suffix) → {string}

Creates an application-scoped localStorage key using a subsystem suffix. Both Highscores and Storage use this method to keep key construction aligned.
Parameters:
Name Type Description
id string Application ID, for example "com.vectorpanic.demo".
suffix string Subsystem suffix, including its leading period.
Source:
Throws:
If the application ID is missing or invalid.
Type
Error
Returns:
The complete localStorage key.
Type
string

(static) createID(id) → {string}

Validates and returns an explicit application ID without changing it. The developer and app segments follow Application's configuration rules.
Parameters:
Name Type Description
id string Application ID, for example "com.vectorpanic.demo".
Source:
Throws:
If the application ID is missing or invalid.
Type
Error
Returns:
The validated identifier.
Type
string