Skip to Content
defold-typescript libraries
widgrensitasobi-defold

widgrensit/asobi-defold/asobi.api.storage

asobi cloud saves and key-value storage over REST. A project reaches it as client.storage.

  • GitHub: widgrensit/asobi-defold — pinned to v1.18.1
    1. Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as api_storage from "asobi.api.storage"

Functions

list_saves(client: Client, callback?: HttpCallback)

Fetches the signed-in player's save slots.

Parameters

  • client: Client — The client.
  • callback?: HttpCallback — Receives the saves, or the error.

get_save(client: Client, slot: string, callback?: HttpCallback)

Fetches one save slot.

Parameters

  • client: Client — The client.
  • slot: string — The slot's name.
  • callback?: HttpCallback — Receives the save, or the error.

put_save(client: Client, slot: string, data: Payload, version?: number, callback?: HttpCallback)

Writes a save slot.

Parameters

  • client: Client — The client.
  • slot: string — The slot's name.
  • data: Payload — The save's contents.
  • version?: number — The version the write expects to replace. Writes unconditionally when left out.
  • callback?: HttpCallback — Receives the save, or the error.

list_storage(client: Client, collection: string, limit?: number, callback?: HttpCallback)

Fetches the entries of a storage collection.

Parameters

  • client: Client — The client.
  • collection: string — The collection's name.
  • limit?: number — The most entries to return. Defaults to 50.
  • callback?: HttpCallback — Receives the entries, or the error.

get_storage(client: Client, collection: string, key: string, callback?: HttpCallback)

Fetches one storage entry.

Parameters

  • client: Client — The client.
  • collection: string — The collection's name.
  • key: string — The entry's key.
  • callback?: HttpCallback — Receives the entry, or the error.

put_storage(client: Client, collection: string, key: string, value: Payload, read_perm?: string, write_perm?: string, callback?: HttpCallback)

Writes a storage entry.

Parameters

  • client: Client — The client.
  • collection: string — The collection's name.
  • key: string — The entry's key.
  • value: Payload — The entry's value.
  • read_perm?: string — Who may read it. Defaults to "owner".
  • write_perm?: string — Who may write it. Defaults to "owner".
  • callback?: HttpCallback — Receives the entry, or the error.

delete_storage(client: Client, collection: string, key: string, callback?: HttpCallback)

Deletes a storage entry.

Parameters

  • client: Client — The client.
  • collection: string — The collection's name.
  • key: string — The entry's key.
  • callback?: HttpCallback — Receives the server's answer, or the error.

On this page