User Identity

The UserIdentity module allows scenes to access the profile for the player's user.

const UserIdentity = require("~system/UserIdentity");

It contains the following methods and types:

Methods

The two methods in this module fetch bits of information from the player's user.

getUserData

Returns the UserData for the player's user.

interface Request {}

interface Response {
  // The profile information for the user, if available.
  data?: UserData;
}

function getUserData(Request): Promise<Response>;

Types

There's just one type in this module: UserData.

UserData

Holds (possibly partial) information about a user, their identity and avatar.

World Explorers can obtain this through the content system.

The profile entity definition details all of these fields and more. While the structure and keys of UserData are slightly different, the meaning of each field is the same.

Last updated