> ## 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.

# De Whop iOS-SDK's installeren

> Installeer de SDK's WhopCheckout en WhopElements met Swift Package Manager en maak de API-sleutel aan die WhopCheckout nodig heeft.

Whop levert zijn iOS-SDK's als afzonderlijke Swift-pakketten: **WhopCheckout** voor betalingen en **WhopElements** voor ingesloten chat en uitbetalingen. Installeer alleen wat je nodig hebt.

## WhopCheckout (in-app-aankopen)

Het pakket WhopCheckout verwerkt abonnementen en betalingen in je app.

### Stap 1: pakketdependency toevoegen

Ga in Xcode naar **File** → **Add Package Dependencies...**.

Voer de pakket-URL in:

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

### Stap 2: versie selecteren

Kies de nieuwste versie of een versiebereik:

* **Up to Next Major**: aanbevolen voor productie
* **Exact Version**: voor stabiliteit

### Stap 3: een API-sleutel aanmaken

De SDK vereist een API-sleutel met alleen de machtiging `iap:read`. Whop heeft deze machtiging ontworpen voor gebruik aan de clientzijde, dus je kunt de sleutel in je app-bundel insluiten.

**1. Open de ontwikkelaarsinstellingen**

Ga naar de [ontwikkelaarsinstellingen van Whop](https://whop.com/dashboard/developer) en selecteer je app.

**2. Maak de API-sleutel aan**

Selecteer **Create API Key** en selecteer daarna **alleen** de machtiging `iap:read`.

**3. Kopieer de sleutel**

Kopieer de gegenereerde sleutel. Je geeft deze in de volgende stap mee aan `Checkout.shared.configure()`.

> [!WARNING]
>
> Verleen alleen de machtiging `iap:read`. Het is de enige machtiging die is ontworpen voor gebruik aan de clientzijde, en ze beperkt de sleutel tot in-app-aankoopbewerkingen. Lever nooit een sleutel met bredere machtigingen mee in je app.

### Stap 4: importeren en configureren

```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] [Een paywall bouwen](https://docs.whop.com/nl/developer/guides/ios/build-a-paywall.md)
>
> Ga verder met de volledige installatiegids

***

## WhopElements (ingesloten chat en wallet)

Gebruik WhopElements om Whop-chatkanalen in je app in te sluiten.

### Stap 1: pakketdependency toevoegen

Ga in Xcode naar **File** → **Add Package Dependencies...**.

Voer de pakket-URL in:

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

### Stap 2: versie selecteren

Kies de nieuwste versie of een versiebereik.

### Stap 3: het specifieke element importeren en configureren

```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] [Ingesloten chat](https://docs.whop.com/nl/developer/guides/chat/quickstart.md)
>
> Ga verder met de gids voor chatintegratie

> [card] [Wallet Elements](https://docs.whop.com/nl/elements/latest/getting-started.md)
>
> Toon de saldi en activiteit van een account met de Swift-wallet-elements

***

## Vereisten

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

## Volgende stappen

> [card] [Een paywall bouwen](https://docs.whop.com/nl/developer/guides/ios/build-a-paywall.md)
>
> Voeg abonnementen en betalingen toe

> [card] [Rechten controleren](https://docs.whop.com/nl/developer/guides/ios/check-entitlements.md)
>
> Scherm content af op basis van de abonnementsstatus

> [card] [Ingesloten chat](https://docs.whop.com/nl/developer/guides/chat/quickstart.md)
>
> Voeg Whop-chat toe aan je app

> [card] [Wallet Elements](https://docs.whop.com/nl/elements/latest/getting-started.md)
>
> Toon de saldi en activiteit van een account met de Swift-wallet-elements

> [card] [API-referentie](https://docs.whop.com/nl/developer/guides/ios/checkout-reference.md)
>
> Volledige SDK-documentatie


## Related topics

- [Een checkout insluiten](https://docs.whop.com/nl/developer/guides/embed-checkout.md)
- [Express Checkout toevoegen](https://docs.whop.com/nl/developer/guides/express-checkout.md)
- [Bouw een checkout met payment elements](https://docs.whop.com/nl/developer/guides/payment-elements.md)
