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- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as api_inventory from "asobi.api.inventory"
- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
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 to1.callback?:HttpCallback— Receives the updated item, or the error.