Skip to Content
defold-typescript libraries
widgrensitasobi-defold

widgrensit/asobi-defold/asobi.api.players

asobi player profiles over REST. A project reaches it as client.players.

  • 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_players from "asobi.api.players"

Functions

get(client: Client, player_id: string, callback?: HttpCallback)

Fetches a player's profile.

Parameters

  • client: Client — The client.
  • player_id: string — The player's id.
  • callback?: HttpCallback — Receives the profile, or the error.

update(client: Client, player_id: string, fields: Payload, callback?: HttpCallback)

Updates a player's profile.

Parameters

  • client: Client — The client.
  • player_id: string — The player's id.
  • fields: Payload — The profile fields to change.
  • callback?: HttpCallback — Receives the profile, or the error.

get_self(client: Client, callback?: HttpCallback)

Fetches the signed-in player's profile. The client must be signed in: it raises an error while client.player_id is unset.

Parameters

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

erase_self(client: Client, password?: string, callback?: HttpCallback)

Erases the signed-in account and everything the server holds for it, which cannot be undone. On success it forgets both tokens and client.player_id; a refused confirmation keeps the session. Needs a server that serves /api/v1/players/me/erase.

Parameters

  • client: Client — The client.
  • password?: string — The account's password, needed only for an account that has one. Leave it out for a guest or a provider-only account.
  • callback?: HttpCallback — Receives the server's answer, or the error.

On this page