> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# 임베디드 채팅 다이렉트 메시지

> 앱 사용자를 위해 다른 Whop 대화와 분리된 비공개 1:1 또는 그룹 다이렉트 메시지를 설정하세요.

다이렉트 메시지는 두 명 이상의 사용자 간 비공개 대화입니다. 앱에 이미 사용자가 있고 제품 안에서 비공개 메시지 기능을 원할 때 사용하세요.

임베디드 채팅에서 DM은 기본적으로 내 계정 컨텍스트에 속합니다. 즉, 사용자는 관련 없는 Whop 메시지가 아니라 앱을 위해 생성된 대화만 보게 됩니다.

## 다이렉트 메시지를 사용해야 하는 경우

특정 멤버만 대화에 참여해야 할 때 다이렉트 메시지를 사용하세요.

예시:

* 앱 안에서 구매자와 판매자 간 메시지
* 코치와 고객 간의 비공개 코칭 스레드
* 프로젝트, 코호트 또는 팀을 위한 소규모 그룹 대화
* 매칭된 두 사용자 간의 마켓플레이스 대화
* 앱 안에서 사용자 간 메시지

### 다이렉트 메시지의 차별점

DM은 특정 사용자 간의 비공개 대화를 위한 채팅 유형입니다.

* 1:1 대화 또는 최대 50명의 그룹 대화가 될 수 있습니다.
* 멤버로 추가된 사용자만 대화를 보고 참여할 수 있습니다.
* [DM 목록 요소](https://docs.whop.com/ko/developer/guides/chat/dms-list-element.md)에 표시되므로 사용자가 최근 대화를 둘러보고 열 수 있습니다.
* 범위를 내 계정으로 지정하여 임베디드 앱에 관련 없는 Whop 메시지와 분리된 자체 받은편지함을 제공할 수 있습니다.
* 사용자 지정 대화 이름과 멤버 관리를 지원합니다.

### 제약 사항

* DM은 상품 멤버십에 따라 접근 권한을 부여하지 않습니다. 접근 권한이 바뀌면 멤버를 직접 추가하거나 제거하세요.
* DM에는 관리자 전용, 읽기 전용 또는 방 수준 모더레이션 제어 기능이 없습니다. 모더레이션이 필요한 방에는 [채널](https://docs.whop.com/ko/developer/guides/chat/channels.md)을 사용하세요.
* DM에는 지원 받은편지함이나 열림/해결됨 워크플로가 없습니다. 고객 지원에는 [지원 채팅](https://docs.whop.com/ko/developer/guides/chat/support-chats.md)을 사용하세요.
* DM은 대규모 커뮤니티, 공지 또는 전체 멤버용 방을 위해 설계되지 않았습니다. 이러한 경우에는 [채널](https://docs.whop.com/ko/developer/guides/chat/channels.md)을 사용하세요.

## 접근 모델

각 DM에는 멤버가 있습니다. 해당 멤버만 대화를 보고 참여할 수 있습니다.

임베디드 채팅용 DM을 생성할 때는 내 계정에 연결된 상태로 유지하세요. 이렇게 하면 앱에 자체 받은편지함이 생기고 대화가 Whop의 나머지 부분과 분리됩니다.

> [!NOTE]
>
> DM 채널 ID는 `feed_`로 시작합니다.

## 다이렉트 메시지 설정하기

**1. 사용자 동기화 또는 생성하기**

모든 참여자에게 Whop 사용자 ID가 있는지 확인하세요. 앱에 자체 사용자가 있다면 먼저 Whop 사용자에 매핑하세요. [사용자 동기화하기](https://docs.whop.com/ko/developer/guides/chat/sync-users.md)를 참고하세요.

**2. DM 채널 생성하기**

`kind`를 `private`로 설정한 [Create Channel](https://docs.whop.com/ko/api-reference/channels/create-channel.md)로 대화를 생성하세요. 다른 멤버는 `participant_user_ids`에 나열합니다. 계정 API 키를 사용하는 경우 `sender_user_id`도 전달하세요.

**3. 필요할 때 멤버 추가하기**

기존 DM에 사용자를 추가하려면 [Add Channel Member](https://docs.whop.com/ko/api-reference/channel-members/add-channel-member.md)를 사용하세요. 제거하려면 [Remove Channel Member](https://docs.whop.com/ko/api-reference/channel-members/remove-channel-member.md)를 사용하세요.

**4. 대화 또는 목록 렌더링하기**

단일 DM에는 [Chat 요소](https://docs.whop.com/ko/developer/guides/chat/chat-element.md)를, 사용자가 대화 중에서 선택할 수 있게 하려면 [DM 목록 요소](https://docs.whop.com/ko/developer/guides/chat/dms-list-element.md)를 사용하세요.

그런 다음 반환된 채널 ID로 DM을 렌더링하세요:

> [tab] React
>
> ```tsx theme={null}
> <ChatElement
>   options={{ channelId: "feed_XXXXXXXXXXXXXX" }}
>   style={{ height: "100dvh", width: "100%" }}
> />
> ```

> [tab] Vanilla JS
>
> ```typescript theme={null}
> const chatElement = session.createElement("chat-element", {
>   channelId: "feed_XXXXXXXXXXXXXX",
> });
>
> chatElement.mount("#chat-container");
> ```

> [tab] Swift
>
> ```swift theme={null}
> WhopChatView(
>     channelId: "feed_XXXXXXXXXXXXXX",
>     style: .imessage
> )
> ```

## 다이렉트 메시지 관리하기

대화를 관리하려면 `kind`를 `private`로 설정한 [List Channels](https://docs.whop.com/ko/api-reference/channels/list-channels.md), [Update Channel](https://docs.whop.com/ko/api-reference/channels/update-channel.md), [Delete Channel](https://docs.whop.com/ko/api-reference/channels/delete-channel.md)을 사용하세요.

참여자를 관리하려면 [List Channel Members](https://docs.whop.com/ko/api-reference/channel-members/list-channel-members.md), [Add Channel Member](https://docs.whop.com/ko/api-reference/channel-members/add-channel-member.md), [Remove Channel Member](https://docs.whop.com/ko/api-reference/channel-members/remove-channel-member.md)를 사용하세요.

> [!TIP]
>
> DM 목록 요소를 사용한다면 사용자가 임베디드 채팅 경험의 대화만 볼 수 있도록 내 계정에 연결된 상태로 유지하세요.

## 다음 단계

> [card] [DM 목록 요소](https://docs.whop.com/ko/developer/guides/chat/dms-list-element.md)
>
> DM 대화를 표시하고 채널 선택을 처리합니다.

> [card] [사용자 동기화하기](https://docs.whop.com/ko/developer/guides/chat/sync-users.md)
>
> DM 채널을 생성하기 전에 Whop 사용자를 생성하거나 매핑하세요.


## Related topics

- [임베디드 채팅 채널](https://docs.whop.com/ko/developer/guides/chat/channels.md)
- [채팅 빠른 시작](https://docs.whop.com/ko/developer/guides/chat/quickstart.md)
- [채널 목록 요소 임베드하기](https://docs.whop.com/ko/developer/guides/chat/dms-list-element.md)
