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

# Development proxy

> Draai de Whop development proxy om tijdens het ontwikkelen de authenticatie en het iframe-gedrag van productie na te bootsen.

In productie draait je app in het Whop-iframe achter een reverse proxy die bij elk request de header `x-whop-user-token` toevoegt. Elke Whop-app verifieert dat token via [`whopsdk.verifyUserToken`](https://docs.whop.com/nl/developer/guides/authentication), dus je hebt dezelfde header nodig op `localhost` om met echte gebruikers te testen. De development proxy voegt hem voor je toe.

> [!WARNING]
>
> `verifyUserToken` is niet beschikbaar in de huidige `@whop/sdk`. De hier beschreven header wordt nog steeds toegevoegd zoals gedocumenteerd.

## Kies je setup

Er zijn twee installatiemodi. Beide gebruiken dezelfde proxy-binary. Het verschil is of de proxy je development server start of ernaast draait.

| | Wrapped (Node/JS) | Standalone |
| - | - | - |
| **Beste voor** | Next.js, Express, alles met een op Node gebaseerd development-script | Python, Ruby, Go, alles wat geen JS is |
| **Hoe het draait** | `whop-proxy --command 'next dev'` start je server | Je server draait op een poort en de proxy stuurt requests daarheen door |
| **Poort** | Eén poort (proxy + server) | Twee poorten (proxy op 3000, server op bijv. 5000) |
| **Installatie** | `pnpm add -D @whop-apps/dev-proxy` | `pnpm dlx @whop-apps/dev-proxy --standalone` (geen installatie nodig) |

## `Next.js`- en `JavaScript`-app

**1. Voeg de proxy toe als development dependency**

```bash pnpm theme={null}
pnpm add -D @whop-apps/dev-proxy
```

```bash bun theme={null}
bun install -D @whop-apps/dev-proxy
```

```bash npm theme={null}
npm install -D @whop-apps/dev-proxy
```

```bash yarn theme={null}
yarn add -D @whop-apps/dev-proxy
```

**2. Werk het dev-script in package.json bij**

Werk het `dev`-script in `package.json` bij zodat het de proxy bevat.

```json theme={null}
"scripts": {
    "dev": "whop-proxy --command 'next dev --turbopack'",
}
```

> [!NOTE]
>
> Je kunt het `dev`-commando aanpassen aan de vereisten van je framework.
> Je kunt op dezelfde manier ook andere commando's met de proxy omhullen.

**3. Draai de proxy**

```bash pnpm theme={null}
pnpm dev
```

```bash npm theme={null}
npm run dev
```

```bash yarn theme={null}
yarn dev
```

## Standalone-modus (andere frameworks)

**1. Draai je app lokaal**

Draai je app op je lokale machine op een poort, bijvoorbeeld 5000.

```bash Python + FastAPI theme={null}
uvicorn main:app --port 5000
```

```bash Ruby on Rails theme={null}
rails server -p 5000
```

```bash Go theme={null}
go run main.go --port 5000
```

**2. Draai de proxy in standalone-modus**

```bash pnpm theme={null}
pnpm dlx @whop-apps/dev-proxy --standalone --upstreamPort=5000 --proxyPort=3000
```

```bash bun theme={null}
bunx @whop-apps/dev-proxy --standalone --upstreamPort=5000 --proxyPort=3000
```

```bash npm theme={null}
npx @whop-apps/dev-proxy --standalone --upstreamPort=5000 --proxyPort=3000
```

```bash yarn theme={null}
yarn dlx @whop-apps/dev-proxy --standalone --upstreamPort=5000 --proxyPort=3000
```

> [!NOTE]
>
> Hiermee draait de proxy als zelfstandig proces. Er wordt een server gestart op
> poort 3000 die requests doorstuurt naar poort 5000 en het gebruikerstoken aan de
> headers toevoegt.

## Opties voor het proxycommando

Configureer de proxy met de volgende opdrachtregelopties:

```bash theme={null}
Usage: pnpm dlx @whop-apps/dev-proxy [options]

Options:

--proxyPort <port>      The port the proxy should listen on (3000 by default)
--upstreamPort <port>   The port the upstream server is listening on (set automatically by default)
--npmCommand <command>  The npm command to run to start the upstream server (dev by default)
--command <command>     The command to run to start the upstream server (npm run dev by default)
--standalone            Run the proxy as an independent process proxying requests from one port to another port. Ignores the command / npmCommand options.
```

## Volgende stappen

> [card] [Authenticatie](https://docs.whop.com/nl/developer/guides/authentication.md)
>
> Verifieer het iframe-gebruikerstoken met dezelfde code, lokaal en in productie.

> [card] [Naar webhooks luisteren](https://docs.whop.com/nl/developer/guides/webhooks.md)
>
> Stuur Whop-webhooks tijdens het ontwikkelen door naar localhost (gebruik ngrok of Cloudflare Tunnel).

> [card] [App-weergaven bouwen](https://docs.whop.com/nl/developer/guides/app-views.md)
>
> Stel de iframe-toegangspunten in waarbinnen je app wordt weergegeven.

> [card] [Permissies aanvragen](https://docs.whop.com/nl/developer/guides/permissions.md)
>
> Configureer de scopes die je app nodig heeft voordat je publiceert.


## Related topics

- [Gebruikers authenticeren in Whop-apps](https://docs.whop.com/nl/developer/guides/authentication.md)
- [App-machtigingen aanvragen](https://docs.whop.com/nl/developer/guides/permissions.md)
- [Whop-apps bouwen met React Native](https://docs.whop.com/nl/developer/guides/react-native.md)
