Upcoming. These docs cover unreleased development, ahead of any published release. Use the channel picker at the top of the sidebar for the docs of a published release.
- Web
- Swift
Whop Elements are hosted, themeable UI components you embed in your own site. Each element renders in an isolated frame served from Whop’s CDN. You install a thin, fully typed package and the element code stays up to date on its own.Prefer npm over the script tag? In React, the same object rides
Install
Mount your first element
loadWhop() injects the same hosted script and resolves the global constructor:Global configuration
Everything you pass at construction applies to every element group created from that instance (a handle’s own options can override per group):Appearance
Visual customization for every element —
theme (light/dark + palettes), variables (CSS custom properties), and classes (per-part style declarations). The color scheme is applied before an element’s first paint, so dark pages never flash light. See Appearance."en" | "es" | "zh" | "nl" | "pt" | "de" | "it" | "fr" | "ja" | "pl" | "tr"
Locale for element UI text — one of the app’s built locales; any other value falls back to the default locale. Defaults to
"en"."production" | "sandbox"
Which Whop API environment the elements talk to —
"sandbox" targets the sandbox API (test data; no real money moves). Choosing an environment is the only way to change where the elements send what a buyer types, and both environments are Whop’s own. The sandbox environment is not yet generally available. Defaults to "production".<WhopElements appearance={…} locale={…}>.Next
- Appearance: theming, CSS variables, and per-part restyling
- Payments: Drives a payment collection surface against the Whop Payments API. Charge config is a plan id OR the inline currency/amount — a plan resolves client-side to the same shape, one path either way. Mount ONE of its faces — the payment element (the full method list), the fused card element, or the exploded card-fields unit — then
payments.createConfirmationToken({ billingDetails })is the ONE confirm verb for all of them: it tokenizes the selection and mints a confirmation token your server confirms with a secret key; the payment’s client_secret then drives any pending step viahandleNextAction. - Checkout: Drives a full hosted checkout for one plan — price summary, promo codes, the currency the buyer pays in, and the whole payment collection surface (the payments elements, composed inside) — against the Whop checkout sessions API. Mount it with a
planand the element creates the checkout session itself; the session credential never leaves the element. Or resume a session you already hold by passing itssessionsecret. The buyer pays inside the element; you getonCompletedwith the payment id. A payment needing an off-site step (3DS, a bank page) is driven automatically — on whop.com the buyer is brought back into the restored checkout, and when you embed the element they return to thereturnUrlyou set. EVERY option here is CREATE-TIME: a checkout session is minted at mount from these values, so changing one later (update(), or new React props) refuses loudly instead of silently charging the booted order — mount a fresh checkout to change what is being bought. - Ads: An advertising account. Scope it to a company with
accountId— the ad account underneath is assigned server-side and never surfaces here — then mountreportingfor what the account spent and what came back, orcampaign-creatorto build a campaign. - Wallet: Drives an account’s money surfaces.
depositreturns live funding rails;sendmoves money to a recipient or creates a public claim link;withdrawcollects a payout request;balancesholds two faces — the holdings list, and the balance block drawing value over a window;cardslists issued cards; andactivitylists ledger movements. Every surface butdepositcan use the viewer’s session when no token is provided. - Websites: An account’s websites: every site built on whop.app plus every domain the Whop Pixel reports, with traffic per domain. Mount
websitesand it lists them with visitors, page views, trend, and most-viewed pages. Reading stats is privileged, so it needs anaccessToken— except inside Whop’s own app, where the viewer’s session carries the read.

