Player-scoped storage interface for key-value pairs from the Server Side Storage service. This is NOT filesystem storage - data is stored in the remote storage service.

Hierarchy

  • IPlayerStorage

Methods

  • Deletes a value from a player's storage in the Server Side Storage service.

    Returns

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

    Parameters

    • address: string

      The player's wallet address

    • key: string

      The key to delete

    Returns Promise<boolean>

  • Retrieves a value from a player's 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 player and 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

    • address: string

      The player's wallet address

    • key: string

      The key to retrieve

    • Optional options: GetOptions

      Optional { fresh } to bypass the read cache

    Returns Promise<null | T>

  • Returns key-value entries from a player's storage, optionally filtered by prefix. Supports pagination via limit and offset.

    Returns

    A promise that resolves to { data, pagination: { offset, total } } for pagination UI

    Parameters

    • address: string

      The player's wallet address

    • Optional options: GetValuesOptions

      Optional { prefix, limit, offset } for filtering and pagination.

    Returns Promise<GetValuesResult>

  • Stores a value in a player's storage in the Server Side Storage service.

    Returns

    A promise that resolves to true if successful, false otherwise

    Type Parameters

    • T = unknown

    Parameters

    • address: string

      The player's wallet address

    • 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>