Overview
The main entry point for Whop embedded components. WhopElements is the root object that manages configuration and creates sessions for different element types. Initialize it once and use it to create sessions for payouts, payments, and other embedded experiences.Installation
Examples
Basic initialization
Creating a payouts session
Updating options after initialization
Listening to option changes
Options
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
appearance | Appearance | undefined | No | - | Customize the appearance of the Whop embedded Elements. Includes theme settings like light/dark mode and accent colors. |
locale | "en" | undefined | No | ”en” | The locale to use for all Elements. Controls the language and formatting of text, dates, and numbers. |
environment | WhopElementsEnvironment | undefined | No | ”production” | The environment to use for API calls. Use ‘“sandbox”’ for testing without affecting production data. |
Events
Events emitted by WhopElements. Listen to these events using theon() method.
optionsUpdated
Emitted when the WhopElements options are updated via updateOptions().
Callback signature: (options: WhopElementsOptions) => void
Methods
createPayoutsSession(options)
Create a new payouts session for managing payout elements.
The session handles authentication and provides methods to create
payout-related elements like balance displays, withdrawal forms, and more.
| Parameter | Type | Description |
|---|---|---|
options | PayoutsSessionOptions | Configuration options for the payouts session |
PayoutsSession
updateOptions(options)
Update the WhopElements configuration after initialization.
Changes will be propagated to all active sessions and elements.
Only the provided options will be updated; others remain unchanged.
| Parameter | Type | Description |
|---|---|---|
options | Partial<WhopElementsOptions> | Partial options object with the values to update |

