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

# CLI로 웹사이트 빌드하기

> Vite 앱을 스캐폴딩하고, 실제 Whop 데이터로 로컬에서 실행한 뒤 whop.site 주소나 자체 도메인에 배포하세요.

명령 네 개면 빈 디렉터리에서 도메인에 게시된 라이브 사이트까지 완성됩니다.

> [!NOTE]
>
> [Whop CLI](https://docs.whop.com/ko/developer/cli.md)를 설치하고 `whop`을 한 번 실행해 로그인하고 비즈니스를 선택하세요.

**1. 앱 만들기**

```bash theme={null}
whop apps init --app_type website --name "Shine Time" --domain shine-time
```

도메인을 확보하고, 해당 도메인에 앱을 등록하고, 프로젝트를 `./shine-time`에 스캐폴딩한 뒤, 디렉터리를 앱에 연결하는 `whop.app.json`을 작성합니다. 플래그를 생략하면 대신 입력을 요청합니다.

`--domain`은 whop.site 이름(`shine-time` → `shine-time.whop.site`) 또는 `shinetime.com` 같은 자체 도메인을 받습니다.

* 이미 비즈니스에 있는 도메인은 그대로 사용됩니다.
* 아무도 등록하지 않은 도메인은 Whop을 통해 구매합니다. CLI가 구매 링크를 반환하며, 그곳에서 결제하기 전까지는 아무것도 청구되지 않습니다.
* 다른 곳에서 소유한 도메인은 연결됩니다. CLI가 나열하는 DNS 레코드를 게시하세요.

결제하거나 해당 레코드를 게시할 때까지 사이트는 그 도메인을 기다립니다. `whop domains get shinetime.com`으로 상태를 확인할 수 있습니다.

> [!WARNING]
>
> `--app_type`은 영구적입니다. `website`는 방문자가 해당 도메인에서 둘러보는 사이트를 의미합니다. `b2c_app`은 크리에이터가 자신의 whop에 설치하는 앱을 의미합니다.

**2. 로컬에서 실행하기**

```bash theme={null}
cd shine-time
whop apps dev
```

호스팅 런타임이 제공하는 것과 같은 환경으로 `dev` 스크립트를 시작합니다. `WHOP_APP_ID`, `WHOP_API_KEY`로 제공되는 단기 토큰, 저장된 모든 [앱 시크릿](https://docs.whop.com/ko/developer/websites/hosting.md#secrets)이 포함됩니다. 서버 측 SDK 호출은 별도 설정 없이 작동합니다. 직접 export한 값이 우선하며, 다시 시작하면 토큰이 갱신됩니다.

**3. 배포하기**

```bash theme={null}
whop apps deploy
```

빌드하고, 타입 검사를 하고, 빌드와 소스 아카이브를 업로드한 뒤 승격합니다. 완료되면 사이트가 라이브 상태가 됩니다.

```bash theme={null}
whop apps deploy --preview                  # upload without going live
whop apps builds promote abld_xxxxxxxx      # ship it later, or roll back to it
```

**4. 실행 상황 확인하기**

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

서버 런타임 로그이며, 7일간 보관됩니다. [호스팅](https://docs.whop.com/ko/developer/websites/hosting.md#logs)을 참고하세요.

## 스캐폴드가 제공하는 것

`whop apps init`은 TanStack 자체 create 명령으로 React 프로젝트를 스캐폴딩한 다음 Whop 연결 설정을 적용합니다.

| 변경 사항 | 이유 |
| - | - |
| `@whop/cli/vite`의 `whop()` 플러그인 | `whop apps deploy`가 업로드하는 아카이브에 `dist/`를 묶습니다 |
| 개발 의존성으로 추가된 `@whop/cli` | Vite 구성이 여기서 플러그인을 가져옵니다 |
| `deploy` 및 `typecheck` 스크립트 | `whop apps deploy`가 실행하는 것 |
| 경로 이름을 딴 빌드 구성 | 프로젝트를 앱과 일치시킵니다 |
| `whop.app.json` | 디렉터리를 앱에 연결합니다 |

## 자체 프레임워크 사용하기

플러그인은 프레임워크에 구애받지 않습니다. TanStack Start, Nitro, Hono 또는 일반 SSR 모두 작동합니다. 유일한 요구 사항은 빌드 구조입니다. 정적 에셋은 `dist/client`에, 서버 번들은 `dist/server`에 있어야 합니다.

```typescript vite.config.ts theme={null}
import { defineConfig } from "vite";
import { whop } from "@whop/cli/vite";

export default defineConfig({
  plugins: [whop()],
});
```

```bash theme={null}
whop apps deploy --app app_xxxxxxxx
```

`--app`은 배포 전에 현재 디렉터리를 기존 앱에 연결하며, `whop.app.json`의 기존 연결을 대체합니다.

## 다른 기기에서 사이트 작업하기

```bash theme={null}
whop apps pull --app app_xxxxxxxx
```

새 기기에서는 프로덕션 빌드의 소스 아카이브로 `./<app name>`을 만듭니다. 기존 프로젝트 안에서는 git을 통해 배포된 소스와 로컬 코드를 3방향 병합합니다. 특정 빌드를 가져오려면 `--build abld_xxxxxxxx`를, 병합을 건너뛰려면 `--overwrite`를 전달하세요.

## 다음 단계

> [card] [호스팅 작동 방식](https://docs.whop.com/ko/developer/websites/hosting.md)
>
> 시크릿, 롤백, 로그, 주입된 API 키.

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

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

> [card] [CLI 레퍼런스](https://docs.whop.com/ko/developer/cli.md)
>
> 모든 명령과 비대화형 사용법.


## Related topics

- [Whop에서 웹사이트 호스팅하기](https://docs.whop.com/ko/developer/websites/overview.md)
- [블루프린트 비즈니스 배포하기](https://docs.whop.com/ko/developer/websites/blueprints.md)
- [CLI와 Claude로 빌드하기](https://docs.whop.com/ko/developer/guides/cli-with-claude.md)
