> 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-pt/runtime-da-scene/modulos-de-runtime/user-identity.md).

# Identidade do utilizador

O `UserIdentity` módulo permite [cenas](https://github.com/decentraland/docs/tree/main/contributor/content/entity-types/scenes/README.md) acessar o [perfil](https://github.com/decentraland/docs/tree/main/contributor/content/entity-types/profiles/README.md) do usuário do jogador.

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

Contém os seguintes métodos e tipos:

* [`function getUserData`](#getUserData)
* [`interface UserData`](#UserData)

### Métodos

Os dois métodos neste módulo obtêm pequenas informações do usuário do jogador.

**`getUserData`**

Retorna o [`UserData`](#UserData) do usuário do jogador.

```ts
interface Request {}

interface Response {
  // As informações do perfil do usuário, se disponíveis.
  data?: UserData;
}

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

### Tipos

Há apenas um tipo neste módulo: `UserData`.

**`UserData`**

Armazena informações (possivelmente parciais) sobre um usuário, sua identidade e avatar.

Os World Explorers podem obter isso por meio do [sistema de conteúdo](https://github.com/decentraland/docs/tree/main/contributor/content/overview/README.md).

O [definição da entidade de perfil](https://github.com/decentraland/docs/tree/main/contributor/content/entity-types/profiles/README.md) detalha todos esses campos e muito mais. Embora a estrutura e as chaves de `UserData` sejam ligeiramente diferentes, o significado de cada campo é o mesmo.

```ts
export interface UserData {
  // O endereço Ethereum do usuário.
  userId: string;

  // Um nome para chamá-lo na UI.
  displayName: string;

  // A chave pública Ethereum com a qual ele assina.
  publicKey?: string;

  // Se a funcionalidade web3 está ativada.
  hasConnectedWeb3: boolean;

  // A versão sequencial dessas informações, incrementada a cada atualização do usuário.
  version: number;

  // Informações sobre seu avatar, se disponíveis.
  avatar?: {
    // Ponteiros para os ativos necessários para renderizar este avatar.
    bodyShape: string;
    wearables: string[];

    // Cores RGB/RGBA codificadas em hexadecimal para diferentes partes do corpo (#aabbcc ou #aabbccdd).
    skinColor: string;
    hairColor: string;
    eyeColor: string;

    // Identificadores de arquivo para as "fotos" deste 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/contributor/contributor-pt/runtime-da-scene/modulos-de-runtime/user-identity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
