> ## 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 iOS SDK 설치하기

> Swift Package Manager로 WhopCheckout 및 WhopElements SDK를 설치하고, WhopCheckout에 필요한 API 키를 만드세요.

Whop은 iOS SDK를 별도의 Swift 패키지로 배포합니다. 결제용 **WhopCheckout**과 임베드 채팅 및 지급용 **WhopElements**입니다. 필요한 것만 설치하세요.

## WhopCheckout(인앱 구매)

WhopCheckout 패키지는 앱의 구독과 결제를 처리합니다.

### 1단계: 패키지 의존성 추가하기

Xcode에서 **File** → **Add Package Dependencies...**로 이동하세요.

패키지 URL을 입력하세요:

```
https://github.com/whopio/whopsdk-checkout-swift
```

### 2단계: 버전 선택하기

최신 버전 또는 버전 범위를 선택하세요:

* **Up to Next Major**: 프로덕션에 권장
* **Exact Version**: 안정성을 위해

### 3단계: API 키 만들기

SDK에는 `iap:read` 권한만 있는 API 키가 필요합니다. Whop은 이 권한을 클라이언트 측 사용을 위해 설계했으므로 앱 번들에 키를 임베드할 수 있습니다.

**1. 개발자 설정 열기**

[Whop 개발자 설정](https://whop.com/dashboard/developer)으로 이동하여 앱을 선택하세요.

**2. API 키 만들기**

**Create API Key**를 선택한 다음 `iap:read` 권한**만** 선택하세요.

**3. 키 복사하기**

생성된 키를 복사하세요. 다음 단계에서 `Checkout.shared.configure()`에 전달합니다.

> [!WARNING]
>
> `iap:read` 권한만 부여하세요. 이는 클라이언트 측 사용을 위해 설계된 유일한 권한이며 키를 인앱 구매 작업으로 제한합니다. 더 넓은 권한을 가진 키를 앱에 포함해 배포하지 마세요.

### 4단계: 임포트 및 구성하기

```swift theme={null}
import SwiftUI
import WhopCheckout

@main
struct YourApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(Checkout.shared)
                .task {
                    try? await Checkout.shared.configure(
                        // companyId: find in Dashboard URL (starts with biz_)
                        companyId: "biz_xxxxxxxxxxxxxx",
                        // apiKey: create in Dashboard > Developer with iap:read permission
                        apiKey: "your_api_key_here",
                        planMappings: [
                            .init(whopId: "plan_xxxxx", appleId: "monthly_sub")
                        ]
                    )
                }
        }
    }
}
```

> [card] [페이월 만들기](https://docs.whop.com/ko/developer/guides/ios/build-a-paywall.md)
>
> 전체 설정 가이드로 계속하세요

***

## WhopElements(임베드 채팅 및 지갑)

WhopElements를 사용해 앱에 Whop 채팅 채널을 임베드하세요.

### 1단계: 패키지 의존성 추가하기

Xcode에서 **File** → **Add Package Dependencies...**로 이동하세요.

패키지 URL을 입력하세요:

```
https://github.com/whopio/whopsdk-elements-swift
```

### 2단계: 버전 선택하기

최신 버전 또는 버전 범위를 선택하세요.

### 3단계: 특정 요소 임포트 및 구성하기

```swift theme={null}
import SwiftUI
import WhopElements

@main
struct YourApp: App {
    var body: some Scene {
        WindowGroup {
            NavigationStack {
                WhopChatView(channelId: "chat_feed_XXXXXXXXXXXXXX")
            }
            .task {
                await WhopSDK.configureWithOAuth(appId: "app_XXXXXXXXXXXXXX")
            }
        }
    }
}
```

> [card] [임베드 채팅](https://docs.whop.com/ko/developer/guides/chat/quickstart.md)
>
> 채팅 통합 가이드로 계속하세요

> [card] [지갑 요소](https://docs.whop.com/ko/elements/latest/getting-started.md)
>
> Swift 지갑 요소로 계정의 잔액과 활동을 표시하세요

***

## 요구 사항

* iOS 17.0+
* Xcode 15.0+
* Swift 5.10+

## 다음 단계

> [card] [페이월 만들기](https://docs.whop.com/ko/developer/guides/ios/build-a-paywall.md)
>
> 구독과 결제를 추가하세요

> [card] [이용 권한 확인하기](https://docs.whop.com/ko/developer/guides/ios/check-entitlements.md)
>
> 구독 상태에 따라 콘텐츠 접근을 제한하세요

> [card] [임베드 채팅](https://docs.whop.com/ko/developer/guides/chat/quickstart.md)
>
> 앱에 Whop 채팅을 추가하세요

> [card] [지갑 요소](https://docs.whop.com/ko/elements/latest/getting-started.md)
>
> Swift 지갑 요소로 계정의 잔액과 활동을 표시하세요

> [card] [API 레퍼런스](https://docs.whop.com/ko/developer/guides/ios/checkout-reference.md)
>
> 전체 SDK 문서


## Related topics

- [Whop 픽셀 설치하기](https://docs.whop.com/ko/developer/ads/pixel.md)
- [Whop API 빠른 시작](https://docs.whop.com/ko/developer/quickstart.md)
- [Shopify에 Whop 픽셀 설치하기](https://docs.whop.com/ko/developer/ads/platforms/shopify.md)
