> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-es/runtime-de-la-escena/modulos-de-runtime/user-identity.md).

# Identidad del usuario

El `UserIdentity` módulo permite [escenas](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md) acceder al [perfil](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/profiles/README.md) del usuario del jugador.

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

Contiene los siguientes métodos y tipos:

* [`función getUserData`](#getUserData)
* [`interfaz UserData`](#UserData)

### Métodos

Los dos métodos en este módulo obtienen fragmentos de información del usuario del jugador.

**`getUserData`**

Devuelve la [`UserData`](#UserData) del usuario del jugador.

```ts
interface Request {}

interface Response {
  // La información de perfil del usuario, si está disponible.
  data?: UserData;
}

function getUserData(Request): Promise<Response>;
```

### Tipos

Hay solo un tipo en este módulo: `UserData`.

**`UserData`**

Contiene información (posiblemente parcial) sobre un usuario, su identidad y avatar.

Los World Explorers pueden obtener esto a través del [content system](https://github.com/decentraland/docs/blob/main/contributor/content/overview/README.md).

El [profile entity definition](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/profiles/README.md) detalla todos estos campos y más. Aunque la estructura y las claves de `UserData` son ligeramente diferentes, el significado de cada campo es el mismo.

```ts
export interface UserData {
  // La dirección de Ethereum del usuario.
  userId: string;

  // Un nombre para llamarlo en la IU.
  displayName: string;

  // La clave pública de Ethereum con la que firma.
  publicKey?: string;

  // Si tienen la funcionalidad web3 habilitada.
  hasConnectedWeb3: boolean;

  // La versión secuencial de esta información, incrementada en cada actualización del usuario.
  version: number;

  // Información sobre su avatar, si está disponible.
  avatar?: {
    // Punteros a los assets requeridos para renderizar este avatar.
    bodyShape: string;
    wearables: string[];

    // Colores RGB/RGBA codificados en hexadecimal para diferentes partes del cuerpo (#aabbcc o #aabbccdd).
    skinColor: string;
    hairColor: string;
    eyeColor: string;

    // Identificadores de archivo para las "fotos" de este avatar.
    snapshots?: {
      face256: string;
      body: string;
    };
  };
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decentraland.org/contributor/contributor-es/runtime-de-la-escena/modulos-de-runtime/user-identity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
