Skip to Content
defold-typescript libraries
widgrensitasobi-defold

widgrensit/asobi-defold/asobi.api.inventory

The asobi inventory over REST. A project reaches it as client.inventory.

  • 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_inventory from "asobi.api.inventory"

Functions

list(client: Client, limit?: number, callback?: HttpCallback)

Fetches the signed-in player's items.

Parameters

  • client: Client — The client.
  • limit?: number — The most items to return. The server's default applies when left out.
  • callback?: HttpCallback — Receives the items, or the error.

consume(client: Client, item_id: string, quantity?: number, callback?: HttpCallback)

Uses up some of an item.

Parameters

  • client: Client — The client.
  • item_id: string — The item's id.
  • quantity?: number — How many to use up. Defaults to 1.
  • callback?: HttpCallback — Receives the updated item, or the error.

On this page