Storage interface with methods for scene-scoped and player-scoped storage.

Hierarchy

Properties

Methods

Properties

Player-scoped storage for key-value pairs

Methods

  • Sets module-wide defaults for both scene-scoped and player-scoped storage. Merges the given partial options into the current configuration. Note: cacheMaxEntries applies per scope (scene and player each keep their own cache) and bounds entry count, not bytes (entries hold serialized value bodies).

    Parameters

    Returns void

  • Deletes a value from scene storage in the Server Side Storage service.

    Returns

    A promise that resolves to true if deleted, false if not found

    Parameters

    • key: string

      The key to delete

    Returns Promise<boolean>

  • Retrieves a value from scene storage by key from the Server Side Storage service.

    By default (cacheReads), values read or written during the last cacheMaxAgeMs are served from a local cache without a network request, including confirmed "not found" results. Concurrent gets for the same key share one request. Out-of-band writers (e.g. CLI storage commands) may not be visible for up to cacheMaxAgeMs — pass { fresh: true } to force a network read.

    Returns

    A promise that resolves to the parsed JSON value, or null if not found

    Type Parameters

    • T = unknown

    Parameters

    • key: string

      The key to retrieve

    • Optional options: GetOptions

      Optional { fresh } to bypass the read cache

    Returns Promise<null | T>

  • Stores a value in scene storage in the Server Side Storage service.

    Type Parameters

    • T = unknown

    Parameters

    • key: string

      The key to store the value under

    • value: T

      The value to store (will be JSON serialized)

    • Optional options: SetOptions

      Optional { skipIfUnchanged } to skip the network write when the value is already stored

    Returns Promise<boolean>