> ## 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의 웹사이트 호스팅

> Whop이 업로드된 빌드로 웹사이트를 실행하는 방식을 알아보세요. 구성할 서버가 없습니다.

Whop은 업로드된 빌드에서 바로 사이트를 제공합니다. 구성할 서버도, 지정할 배포 대상도 없습니다.

## 빌드와 버전

배포할 때마다 빌드가 생성되며, 한 번에 정확히 하나의 빌드만 프로덕션이 됩니다.

```bash theme={null}
whop apps deploy                            # build, upload, promote
whop apps deploy --preview                  # upload only
whop apps builds promote abld_xxxxxxxx      # make a build live
```

이전 빌드를 승격하는 것이 곧 롤백이며, 별도의 되돌리기 명령은 없습니다. 대시보드에서는 **Versions** 탭을 사용하세요.

Vite 플러그인이 빌드를 업로드할 아카이브로 묶습니다. `dist/client`의 에셋은 직접 제공되고, `dist/server`는 서버 코드를 실행합니다.

## 시크릿

앱 시크릿은 런타임에 환경 변수가 되는 암호화된 바인딩입니다.

```bash theme={null}
whop apps secrets list
whop apps secrets set --secret MAIL_API_KEY=mail-key-123
whop apps secrets unset --key MAIL_API_KEY
```

이 명령은 연결된 프로젝트 안에서 실행하거나 `--app app_xxxxxxxx`를 전달하세요. `whop apps dev`는 로컬 런타임을 제어하는 이름을 제외하고 같은 시크릿을 로컬에 주입합니다. 직접 export한 환경 변수가 항상 우선합니다.

런타임은 다음도 설정합니다.

| 바인딩 | 용도 |
| - | - |
| `APP_ID` | 제공 중인 앱 |
| `BUILD_ID` | 현재 승격된 빌드 |
| `WHOP_API_ORIGIN` | 요청을 보낼 Whop API 오리진 |
| `WHOP_ACCOUNT_ID` | 앱을 소유한 계정의 `biz_` ID. API 읽기 범위를 자신의 카탈로그로 지정할 때 사용 |
| `ASSETS` | 정적 에셋 제공 |
| `REALTIME` | 실시간 연결 지원 |

> [!NOTE]
>
> 이 이름들은 예약되어 있어, 같은 이름의 시크릿은 무시됩니다.

## Whop API 호출하기

서버 측 `fetch` 호출은 Whop API 요청에 앱의 API 키를 첨부하는 아웃바운드 프록시를 거칩니다.

```typescript src/routes/api.account.ts theme={null}
const response = await fetch(`${process.env.WHOP_API_ORIGIN}/api/v1/accounts/me`);
const account = await response.json();
```

키는 코드에 절대 전달되지 않으므로 읽거나, 기록하거나, 번들에 포함될 수 없습니다. 다른 곳으로 가는 요청은 그대로 통과합니다.

* **서버 측 호출만 서명됩니다.** 브라우저 `fetch`는 서버가 아니라 방문자의 기기에서 나갑니다. 이런 호출은 자체 핸들러를 거치도록 하세요.
* 서버 측 요청을 인증 없이 보내려면 **`x-whop-inject-key: none`을 보내세요**.

> [!WARNING]
>
> 주입된 키는 앱을 소유한 비즈니스에 속하며 돈을 이동시킬 수 없습니다. 지급 및 이체 **읽기**는 허용됩니다. 자금 인출, 이체 전송, 지급 대상 관리는 허용되지 않으므로, 자체 키를 제공하기 전까지 스코프 오류를 반환합니다. 또한 이 키는 방문자가 아니라 항상 내 비즈니스로 인증됩니다. 방문자 신원이 필요하면 [OAuth](https://docs.whop.com/ko/developer/guides/oauth.md)를 사용하세요.

## 예약 실행

호스팅된 앱은 요청 없이 cron으로도 실행할 수 있습니다. 앱에 `schedule` 또는 `per_install_schedule`을 설정하고 `fetch()` 옆에 `scheduled()`를 export하세요. [예약 실행](https://docs.whop.com/ko/developer/guides/scheduled-runs.md)을 참고하세요.

## 로그

런타임은 모든 `console.log`, 처리되지 않은 예외, 실패한 요청을 7일간 보관합니다.

```bash theme={null}
whop apps logs app_xxxxxxxx
whop apps logs app_xxxxxxxx --level error
whop apps logs app_xxxxxxxx --query "checkout"
```

기간을 선택하려면 ISO 8601 타임스탬프와 함께 `--created_after` 및 `--created_before`를 사용하세요. 클라이언트 측 JavaScript 오류는 여기에 없으며, 방문자의 브라우저 콘솔에 있습니다.

## 다음 단계

> [card] [방문자 추적하기](https://docs.whop.com/ko/developer/websites/tracking.md)
>
> 픽셀은 이미 설치되어 있습니다. 자체 이벤트를 추가하세요.

> [card] [블루프린트](https://docs.whop.com/ko/developer/websites/blueprints.md)
>
> 빈 프로젝트 대신 작동하는 비즈니스에서 시작하세요.

> [card] [결제 받기](https://docs.whop.com/ko/developer/guides/accept-payments.md)
>
> 호스팅 중인 사이트에서 바로 판매하세요.

> [card] [CLI 레퍼런스](https://docs.whop.com/ko/developer/cli.md)
>
> 모든 `whop apps` 명령.


## Related topics

- [Whop에서 웹사이트 호스팅하기](https://docs.whop.com/ko/developer/websites/overview.md)
- [웹사이트](https://docs.whop.com/ko/elements/latest/websites/overview.md)
- [Whop API 개요](https://docs.whop.com/ko/api-reference/overview.md)
