> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/documentation/sdk/domains-api/game/game.getuserprofile.md).

# Game.getUserProfile

> 함수형 API `getGameCenterGameProfile`로도 같은 기능을 쓸 수 있어요.

### 기능 설명

토스게임센터 프로필 정보를 가져와요. 프로필이 없으면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요. 프로필이 있으면 닉네임과 프로필 이미지 URL이 함께 제공돼요.

토스앱 Android/iOS `5.221.0` 이상에서 사용할 수 있어요. 브릿지 응답을 받지 못한 환경에서는 `undefined`가 반환될 수 있어요.

### 타입

```ts
Game.getUserProfile(): Promise<GameCenterGameProfileResponse | undefined>;
```

**Params**

없음

**Response**

```ts
type GameCenterGameProfileResponse =
  | { statusCode: "PROFILE_NOT_FOUND" }
  | {
      statusCode: "SUCCESS";
      nickname: string;
      profileImageUri: string;
    };
```

### 예시 코드

```js
import { Game } from "@apps-in-toss/web-framework";

const button = document.querySelector("#load-profile");
const nicknameElement = document.querySelector("#nickname");

button.addEventListener("click", async () => {
  try {
    const profile = await Game.getUserProfile();

    if (profile?.statusCode === "SUCCESS") {
      nicknameElement.textContent = profile.nickname;
      console.log(profile.nickname, profile.profileImageUri);
    } else {
      console.log("프로필이 없어요.");
    }
  } catch (error) {
    console.error(error);
  }
});
```


---

# 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, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/documentation/sdk/domains-api/game/game.getuserprofile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
