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

# Websites

> An account's websites: every site built on whop.app plus every domain the Whop Pixel reports, with traffic per domain. Mount `websites` and it lists them with visitors, page views, trend, and most-viewed pages. Reading stats is privileged, so it needs an `accessToken` — except inside Whop's own app, where the viewer's session carries the read.

<Info>**Upcoming** — generated from the latest merged element source; documents unreleased development. Use the channel picker at the top of the sidebar for the docs of a published release.</Info>

*In development — not yet part of a stable release.*

## Playground

Assemble the elements with sample data — drive the controls, add and arrange elements, and watch events fire live:

<div data-whop-demo-shell style={{ position: "relative", minHeight: "480px", transition: "min-height 200ms ease" }}>
  <div data-whop-demo-skeleton style={{ position: "absolute", inset: "0", borderRadius: "12px", background: "rgba(140, 140, 140, 0.12)", pointerEvents: "none", transition: "opacity 200ms ease" }} />

  <div data-whop-demo-native="playground:websites" data-whop-elements-version="" style={{ position: "relative" }} />
</div>

## Usage

<div data-whop-usage="websites/playground">
  <CodeGroup>
    ```tsx React theme={null}
    import { WhopElements, Websites } from "@whop/elements-react";
    import { loadWhop } from "@whop/elements";

    function Example() {
      return (
        <WhopElements elements={loadWhop()}>
          <Websites /* options */>
            {/* mount elements here */}
          </Websites>
        </WhopElements>
      );
    }
    ```

    ```html Vanilla theme={null}
    <script src="https://js.whop.cloud/elements/amber/elements.js" data-whop-elements></script>
    <script type="module">
      const websites = window.WhopElements().websites.create({ /* options */ });
    </script>
    ```
  </CodeGroup>
</div>

## Options

Pass these to `whop.websites.create({ … })` — or as props on `<Websites>` in React.

<ResponseField name="windowDays" type="number">
  How many days of traffic the table covers, from 1 to 90. @default 30 Defaults to `30`.
</ResponseField>

<ResponseField name="includeApps" type="boolean">
  List websites built on whop.app from the moment they exist, with zeros until traffic arrives. Turn off to show only domains the pixel reports. @default true Defaults to `true`.
</ResponseField>

<ResponseField name="pendingWebsites" type="PendingWebsite[]">
  Websites you have just added that are not live yet — `{ domain, kind }`, where `kind` is `deploy` for a whop.app site waiting on its first deploy or `events` for a site waiting on its first pixel events. They render as waiting rows so a site never looks lost right after setup, and the table polls while any is outstanding. Defaults to `[]`.
</ResponseField>

<ResponseField name="showVerify" type="boolean">
  Add a pixel-check button to each row. The element only reports the press through `onVerifyRequested` — opening the site and deciding the outcome is yours, because a popup opened by your own page is the one browsers trust. Defaults to `false`.
</ResponseField>

<ResponseField name="showSettings" type="boolean">
  Add a settings button to whop.app rows. The element only reports the press through `onSettingsRequested` — the editing surface is yours. Defaults to `false`.
</ResponseField>

<ResponseField name="verifyTarget" type="string">
  Which row the check in progress belongs to — the `target` from the `verifyRequested` event you are handling. Defaults to `""`.
</ResponseField>

<ResponseField name="verifyStatus" type="&#x22;idle&#x22; | &#x22;waiting&#x22; | &#x22;connected&#x22; | &#x22;not-detected&#x22; | &#x22;blocked&#x22;">
  How the check in progress is going, shown on that row’s button: `waiting`, `connected`, `not-detected`, or `blocked` when the popup was blocked. Defaults to `"idle"`.
</ResponseField>

<ResponseField name="accessToken" type="string">
  A scoped token for the reads — stats need `stats:read`, and the whop.app website list reads apps (rows degrade to traffic-only if the token can’t). Mint it on your server with `POST /v1/access_tokens` and set a fresh one before it expires. Omitted, the reads carry the viewer’s own session, which only answers same-origin.
</ResponseField>

<ResponseField name="accountId" type="string" required>
  The company whose websites these surfaces read — `biz_…`.
</ResponseField>

<ResponseField name="appearance" type="Appearance">
  Visual customization for this group's elements — overrides the global `WhopElements({ appearance })`; change it live with `update({ appearance })`.
</ResponseField>

<ResponseField name="locale" type="WhopElementsLocale">
  Locale for this group's element UI text — one of the app's built locales, overriding the global config; any other value falls back to the default locale.
</ResponseField>

## Events

Pass a callback in the create options / React props.

### `onLoadingChange`

Fired when the grouped loading state changes — `true` while any mounted element is still loading.

**Signature:** `((loading: boolean) => void)`

## Methods

Call these on the Websites handle — the return of `whop.websites.create({ … })` (vanilla) or `useWebsites()` (React).

### `update`

Update the handle live: any of its options (`appearance` and `locale` included), propagated to every mounted element. React consumers never call it — updating the namespace component's props does the same.

**Signature:** `(options: Partial<WebsitesOptions>) => void`

## Returned objects

Live objects returned by the methods above — hold the reference and call it on your page; these are capabilities, not serializable data.

## `PendingWebsite`

The public surface of `PendingWebsite`.

### `domain`

**Signature:** `string`

### `kind`

**Signature:** `"events" | "deploy"`

## Elements

The elements this group mounts — each has its own page:

<CardGroup cols={2}>
  <Card title="WebsitesElement" href="/elements/upcoming/websites/websites">
    An account's websites in one table: every site built on whop.app — listed from the moment it exists, zeros until traffic arrives — merged by hostname with every domain the Whop Pixel reports. Each row shows a page-view trend, unique visitors, page views, and the last day an event arrived. Expanding a domain loads its most-viewed pages, and each page-view figure opens the breakdown of which events made it up. Set `showVerify` to add a per-row button that asks the page hosting this element to open the site and confirm the pixel is firing; set `showSettings` to add a settings button on whop.app rows that reports the click through `onSettingsRequested` — your page owns the actual editing.
  </Card>
</CardGroup>
