@whop/elements 1.0.0-beta.2 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_framework.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The locales this app's elements are built with (the default locale first) — element UI
2
2
  * text ships in each of these. Any other value falls back to the default locale. Validate
3
3
  * dynamic strings with `WHOP_ELEMENTS_LOCALES.includes(...)` from the package root. */
4
- export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "it" | "fr" | "ja" | "pl" | "tr";
4
+ export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "hu" | "it" | "fr" | "ja" | "pl" | "tr";
5
5
 
6
6
  /**
7
7
  * A CSS property value, as a string (include units: `"12px"`, not `12`).
@@ -172,6 +172,11 @@ export interface FrameworkGlobals {
172
172
  * ("Payment method added", "Payment failed") rendered in the bottom-right corner. Set
173
173
  * `false` to turn them off entirely. @default true */
174
174
  toasts?: boolean;
175
+ /** Skip linking element analytics to the Whop pixel's visitor id on pages that run the
176
+ * pixel — a one-time identity link that makes element activity joinable to your
177
+ * ad-attribution data in Whop's identity graph. Usage analytics themselves are unaffected
178
+ * (turn those off per handle with `analytics: false`). @default false */
179
+ skipPixel?: boolean;
175
180
  /** Origin serving the hosted element pages — for testing against a different environment.
176
181
  * Cannot change after load.
177
182
  * @internal */
package/_framework.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The locales this app's elements are built with (the default locale first) — element UI
2
2
  * text ships in each of these. Any other value falls back to the default locale. Validate
3
3
  * dynamic strings with `WHOP_ELEMENTS_LOCALES.includes(...)` from the package root. */
4
- export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "it" | "fr" | "ja" | "pl" | "tr";
4
+ export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "hu" | "it" | "fr" | "ja" | "pl" | "tr";
5
5
 
6
6
  /**
7
7
  * A CSS property value, as a string (include units: `"12px"`, not `12`).
@@ -172,6 +172,11 @@ export interface FrameworkGlobals {
172
172
  * ("Payment method added", "Payment failed") rendered in the bottom-right corner. Set
173
173
  * `false` to turn them off entirely. @default true */
174
174
  toasts?: boolean;
175
+ /** Skip linking element analytics to the Whop pixel's visitor id on pages that run the
176
+ * pixel — a one-time identity link that makes element activity joinable to your
177
+ * ad-attribution data in Whop's identity graph. Usage analytics themselves are unaffected
178
+ * (turn those off per handle with `analytics: false`). @default false */
179
+ skipPixel?: boolean;
175
180
  /** Origin serving the hosted element pages — for testing against a different environment.
176
181
  * Cannot change after load.
177
182
  * @internal */
package/ads.d.cts CHANGED
@@ -120,6 +120,11 @@ export interface CampaignCreatorElementProps {
120
120
  * @default "campaign-settings"
121
121
  */
122
122
  initialStep?: "ads" | "ad-groups" | "campaign-settings";
123
+ /**
124
+ * File IDs (`file_…`) your app uploaded via `POST /api/v1/files`, offered in the builder's creative library. They show first in the library list, in this order, and while any are set the media pickers open on the library instead of the upload drop zone. Create the files with the same API key that mints the `ads` handle's `accessToken` — the builder reads them back in one batch (`GET /api/v1/files`), and file reads only answer the credential that created them. Pass at most 250 IDs, the batch read's limit. A file appears once its upload has finished processing; an ID that never finishes, or that points at something other than an image or video, is left out. Pass new IDs with `update({ externalMediaIds })` to stream media into a builder that is already open.
125
+ * @default []
126
+ */
127
+ externalMediaIds?: string[];
123
128
  }
124
129
 
125
130
  /**
@@ -171,6 +176,11 @@ export interface CampaignCreatorElementCreateOptions {
171
176
  * @default "campaign-settings"
172
177
  */
173
178
  initialStep?: "ads" | "ad-groups" | "campaign-settings";
179
+ /**
180
+ * File IDs (`file_…`) your app uploaded via `POST /api/v1/files`, offered in the builder's creative library. They show first in the library list, in this order, and while any are set the media pickers open on the library instead of the upload drop zone. Create the files with the same API key that mints the `ads` handle's `accessToken` — the builder reads them back in one batch (`GET /api/v1/files`), and file reads only answer the credential that created them. Pass at most 250 IDs, the batch read's limit. A file appears once its upload has finished processing; an ID that never finishes, or that points at something other than an image or video, is left out. Pass new IDs with `update({ externalMediaIds })` to stream media into a builder that is already open.
181
+ * @default []
182
+ */
183
+ externalMediaIds?: string[];
174
184
  /**
175
185
  * The account owner backed out of the builder without launching. Nothing has been discarded — a draft campaign, if one was started, is already saved. An overlay has already closed itself by the time this fires; react to it if your page needs to.
176
186
  */
@@ -394,6 +404,16 @@ export interface TableElementProps {
394
404
  * @default true
395
405
  */
396
406
  showPausedCampaigns?: boolean;
407
+ /**
408
+ * Whether paused ad groups are listed.
409
+ * @default true
410
+ */
411
+ showPausedAdGroups?: boolean;
412
+ /**
413
+ * Whether paused ads are listed.
414
+ * @default true
415
+ */
416
+ showPausedAds?: boolean;
397
417
  }
398
418
 
399
419
  /**
@@ -455,6 +475,16 @@ export interface TableElementCreateOptions {
455
475
  * @default true
456
476
  */
457
477
  showPausedCampaigns?: boolean;
478
+ /**
479
+ * Whether paused ad groups are listed.
480
+ * @default true
481
+ */
482
+ showPausedAdGroups?: boolean;
483
+ /**
484
+ * Whether paused ads are listed.
485
+ * @default true
486
+ */
487
+ showPausedAds?: boolean;
458
488
  /**
459
489
  * The open tab changed. Mirror it into your own URL if you want it to survive a reload.
460
490
  */
@@ -472,9 +502,9 @@ export interface TableElementCreateOptions {
472
502
  */
473
503
  onCustomMetricsChanged?: ((payload: { customMetrics: CustomMetricDefinition[]; }) => void);
474
504
  /**
475
- * The viewer moved one of the table’s own controls — the All tab’s drill, the breakdown, the search box, the paused toggle. Carries all four whichever moved; store them and pass them back as props, or they reset on the next mount.
505
+ * The viewer moved one of the table’s own controls — the All tab’s drill, the breakdown, the search box, the paused toggle on any of the three tabs. Carries all of them whichever moved; store them and pass them back as props, or they reset on the next mount.
476
506
  */
477
- onViewChanged?: ((payload: { sourcesDrill: string | null; breakdown: "age" | "gender" | "age_gender" | "placement" | "publisher_platform" | "device_platform" | "impression_device" | "country" | "region" | "hour" | null; query: string; showPausedCampaigns: boolean; }) => void);
507
+ onViewChanged?: ((payload: { sourcesDrill: string | null; breakdown: "age" | "gender" | "age_gender" | "placement" | "publisher_platform" | "device_platform" | "impression_device" | "country" | "region" | "hour" | null; query: string; showPausedCampaigns: boolean; showPausedAdGroups: boolean; showPausedAds: boolean; }) => void);
478
508
  /**
479
509
  * What the All tab is now looking at, as source paths ready to hand to a chart: `null` off the All tab (Whop advertising alone), `[]` for every source, otherwise the ticked rows or the drilled-into group. Every surface under the same handle has already followed it.
480
510
  */
package/ads.d.ts CHANGED
@@ -120,6 +120,11 @@ export interface CampaignCreatorElementProps {
120
120
  * @default "campaign-settings"
121
121
  */
122
122
  initialStep?: "ads" | "ad-groups" | "campaign-settings";
123
+ /**
124
+ * File IDs (`file_…`) your app uploaded via `POST /api/v1/files`, offered in the builder's creative library. They show first in the library list, in this order, and while any are set the media pickers open on the library instead of the upload drop zone. Create the files with the same API key that mints the `ads` handle's `accessToken` — the builder reads them back in one batch (`GET /api/v1/files`), and file reads only answer the credential that created them. Pass at most 250 IDs, the batch read's limit. A file appears once its upload has finished processing; an ID that never finishes, or that points at something other than an image or video, is left out. Pass new IDs with `update({ externalMediaIds })` to stream media into a builder that is already open.
125
+ * @default []
126
+ */
127
+ externalMediaIds?: string[];
123
128
  }
124
129
 
125
130
  /**
@@ -171,6 +176,11 @@ export interface CampaignCreatorElementCreateOptions {
171
176
  * @default "campaign-settings"
172
177
  */
173
178
  initialStep?: "ads" | "ad-groups" | "campaign-settings";
179
+ /**
180
+ * File IDs (`file_…`) your app uploaded via `POST /api/v1/files`, offered in the builder's creative library. They show first in the library list, in this order, and while any are set the media pickers open on the library instead of the upload drop zone. Create the files with the same API key that mints the `ads` handle's `accessToken` — the builder reads them back in one batch (`GET /api/v1/files`), and file reads only answer the credential that created them. Pass at most 250 IDs, the batch read's limit. A file appears once its upload has finished processing; an ID that never finishes, or that points at something other than an image or video, is left out. Pass new IDs with `update({ externalMediaIds })` to stream media into a builder that is already open.
181
+ * @default []
182
+ */
183
+ externalMediaIds?: string[];
174
184
  /**
175
185
  * The account owner backed out of the builder without launching. Nothing has been discarded — a draft campaign, if one was started, is already saved. An overlay has already closed itself by the time this fires; react to it if your page needs to.
176
186
  */
@@ -394,6 +404,16 @@ export interface TableElementProps {
394
404
  * @default true
395
405
  */
396
406
  showPausedCampaigns?: boolean;
407
+ /**
408
+ * Whether paused ad groups are listed.
409
+ * @default true
410
+ */
411
+ showPausedAdGroups?: boolean;
412
+ /**
413
+ * Whether paused ads are listed.
414
+ * @default true
415
+ */
416
+ showPausedAds?: boolean;
397
417
  }
398
418
 
399
419
  /**
@@ -455,6 +475,16 @@ export interface TableElementCreateOptions {
455
475
  * @default true
456
476
  */
457
477
  showPausedCampaigns?: boolean;
478
+ /**
479
+ * Whether paused ad groups are listed.
480
+ * @default true
481
+ */
482
+ showPausedAdGroups?: boolean;
483
+ /**
484
+ * Whether paused ads are listed.
485
+ * @default true
486
+ */
487
+ showPausedAds?: boolean;
458
488
  /**
459
489
  * The open tab changed. Mirror it into your own URL if you want it to survive a reload.
460
490
  */
@@ -472,9 +502,9 @@ export interface TableElementCreateOptions {
472
502
  */
473
503
  onCustomMetricsChanged?: ((payload: { customMetrics: CustomMetricDefinition[]; }) => void);
474
504
  /**
475
- * The viewer moved one of the table’s own controls — the All tab’s drill, the breakdown, the search box, the paused toggle. Carries all four whichever moved; store them and pass them back as props, or they reset on the next mount.
505
+ * The viewer moved one of the table’s own controls — the All tab’s drill, the breakdown, the search box, the paused toggle on any of the three tabs. Carries all of them whichever moved; store them and pass them back as props, or they reset on the next mount.
476
506
  */
477
- onViewChanged?: ((payload: { sourcesDrill: string | null; breakdown: "age" | "gender" | "age_gender" | "placement" | "publisher_platform" | "device_platform" | "impression_device" | "country" | "region" | "hour" | null; query: string; showPausedCampaigns: boolean; }) => void);
507
+ onViewChanged?: ((payload: { sourcesDrill: string | null; breakdown: "age" | "gender" | "age_gender" | "placement" | "publisher_platform" | "device_platform" | "impression_device" | "country" | "region" | "hour" | null; query: string; showPausedCampaigns: boolean; showPausedAdGroups: boolean; showPausedAds: boolean; }) => void);
478
508
  /**
479
509
  * What the All tab is now looking at, as source paths ready to hand to a chart: `null` off the All tab (Whop advertising alone), `[]` for every source, otherwise the ticked rows or the drilled-into group. Every surface under the same handle has already followed it.
480
510
  */
package/checkout.d.cts CHANGED
@@ -15,7 +15,7 @@ export interface CheckoutOptions {
15
15
  */
16
16
  plan?: string;
17
17
  /**
18
- * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
18
+ * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold (or, in `setup` mode, no plan — the checkout saves a payment method and charges nothing) and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
19
19
  */
20
20
  checkoutConfiguration?: string;
21
21
  /**
@@ -115,7 +115,7 @@ export interface CheckoutElementCreateOptions {
115
115
  */
116
116
  export interface ExpressCheckoutElementProps {
117
117
  /**
118
- * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device or the served matrix cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds).
118
+ * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device, the served matrix, or the checkout’s payment method configuration cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds). Apple Pay also needs the page’s domain verified as a [payment method domain](/api-reference/beta/payment-method-domains/payment-method-domain) — first-party whop.com pages are pre-approved; on any other site, register and verify the domain or the Apple Pay button stays hidden.
119
119
  * @default ["apple_pay","google_pay"]
120
120
  */
121
121
  wallets?: ("apple_pay" | "google_pay")[];
@@ -156,7 +156,7 @@ export interface ExpressCheckoutElementHandle {
156
156
  */
157
157
  export interface ExpressCheckoutElementCreateOptions {
158
158
  /**
159
- * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device or the served matrix cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds).
159
+ * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device, the served matrix, or the checkout’s payment method configuration cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds). Apple Pay also needs the page’s domain verified as a [payment method domain](/api-reference/beta/payment-method-domains/payment-method-domain) — first-party whop.com pages are pre-approved; on any other site, register and verify the domain or the Apple Pay button stays hidden.
160
160
  * @default ["apple_pay","google_pay"]
161
161
  */
162
162
  wallets?: ("apple_pay" | "google_pay")[];
@@ -190,7 +190,7 @@ export interface CheckoutHandle {
190
190
  */
191
191
  create(name: "checkout", options?: CheckoutElementCreateOptions): CheckoutElementHandle;
192
192
  /**
193
- * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a shipping address for physical goods, a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with, using the served button art, and renders nothing where no wallet is available. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
193
+ * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a phone number where the seller collects one, a shipping address for physical goods, and in Apple Pay a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with — and the checkout's own payment method configuration allows — using the served button art, and renders nothing where no wallet is available. Apple Pay additionally requires the page's domain to be a verified payment method domain: first-party whop.com pages are pre-approved, and any other site must register its domain through the Payment Method Domains API before the button renders there. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
194
194
  * Exclusive slot `entry`. Mount exactly one of: checkout | expressCheckout.
195
195
  */
196
196
  create(name: "expressCheckout", options?: ExpressCheckoutElementCreateOptions): ExpressCheckoutElementHandle;
package/checkout.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface CheckoutOptions {
15
15
  */
16
16
  plan?: string;
17
17
  /**
18
- * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
18
+ * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold (or, in `setup` mode, no plan — the checkout saves a payment method and charges nothing) and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
19
19
  */
20
20
  checkoutConfiguration?: string;
21
21
  /**
@@ -115,7 +115,7 @@ export interface CheckoutElementCreateOptions {
115
115
  */
116
116
  export interface ExpressCheckoutElementProps {
117
117
  /**
118
- * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device or the served matrix cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds).
118
+ * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device, the served matrix, or the checkout’s payment method configuration cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds). Apple Pay also needs the page’s domain verified as a [payment method domain](/api-reference/beta/payment-method-domains/payment-method-domain) — first-party whop.com pages are pre-approved; on any other site, register and verify the domain or the Apple Pay button stays hidden.
119
119
  * @default ["apple_pay","google_pay"]
120
120
  */
121
121
  wallets?: ("apple_pay" | "google_pay")[];
@@ -156,7 +156,7 @@ export interface ExpressCheckoutElementHandle {
156
156
  */
157
157
  export interface ExpressCheckoutElementCreateOptions {
158
158
  /**
159
- * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device or the served matrix cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds).
159
+ * Which wallets may render — a filter over what the buyer’s device actually offers. The element never shows a wallet the device, the served matrix, or the checkout’s payment method configuration cannot back, and the render order stays best-native-first whatever order this lists. An empty list renders nothing (warned in dev builds). Apple Pay also needs the page’s domain verified as a [payment method domain](/api-reference/beta/payment-method-domains/payment-method-domain) — first-party whop.com pages are pre-approved; on any other site, register and verify the domain or the Apple Pay button stays hidden.
160
160
  * @default ["apple_pay","google_pay"]
161
161
  */
162
162
  wallets?: ("apple_pay" | "google_pay")[];
@@ -190,7 +190,7 @@ export interface CheckoutHandle {
190
190
  */
191
191
  create(name: "checkout", options?: CheckoutElementCreateOptions): CheckoutElementHandle;
192
192
  /**
193
- * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a shipping address for physical goods, a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with, using the served button art, and renders nothing where no wallet is available. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
193
+ * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a phone number where the seller collects one, a shipping address for physical goods, and in Apple Pay a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with — and the checkout's own payment method configuration allows — using the served button art, and renders nothing where no wallet is available. Apple Pay additionally requires the page's domain to be a verified payment method domain: first-party whop.com pages are pre-approved, and any other site must register its domain through the Payment Method Domains API before the button renders there. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
194
194
  * Exclusive slot `entry`. Mount exactly one of: checkout | expressCheckout.
195
195
  */
196
196
  create(name: "expressCheckout", options?: ExpressCheckoutElementCreateOptions): ExpressCheckoutElementHandle;
package/index.cjs CHANGED
@@ -28,7 +28,7 @@ __export(npm_loader_exports, {
28
28
  module.exports = __toCommonJS(npm_loader_exports);
29
29
 
30
30
  // <define:__WHOP_ELEMENTS_LOCALES__>
31
- var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "it", "fr", "ja", "pl", "tr"];
31
+ var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "hu", "it", "fr", "ja", "pl", "tr"];
32
32
 
33
33
  // ../../packages/elements-codegen/src/cli/build/npm-loader.ts
34
34
  var ORIGIN = "https://js.whop.cloud";
package/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { FrameworkGlobals, WhopElementsLocale } from "./_framework.js";
2
2
  import type { PaymentsHandle, PaymentsOptions, PaymentsStatics } from "./payments.js";
3
+ import type { VerificationsHandle, VerificationsOptions, VerificationsStatics } from "./verifications.js";
3
4
  import type { CheckoutHandle, CheckoutOptions, CheckoutStatics } from "./checkout.js";
4
5
  import type { AdsHandle, AdsOptions, AdsStatics } from "./ads.js";
5
6
  import type { TrackingHandle, TrackingOptions, TrackingStatics } from "./tracking.js";
@@ -12,11 +13,15 @@ export interface WhopGlobalConfig extends FrameworkGlobals {}
12
13
  /** The configured instance: one accessor per namespace, each carrying `create()` plus that namespace's static actions. */
13
14
  export interface Whop {
14
15
  /**
15
- * Collect a payment from a `plan_` ID or inline currency and amount. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's `client_secret` to `handleNextAction` for any pending step.
16
+ * Browse account payments with PaymentsElement, collect a payment from a `plan_` ID or inline currency and amount, or save a payment method without charging with `mode: "setup"`. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's or setup intent's `client_secret` to `handleNextAction` for any pending step.
16
17
  */
17
18
  payments: { create(options: PaymentsOptions): PaymentsHandle } & PaymentsStatics;
18
19
  /**
19
- * 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 `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
20
+ * Collects and verifies identity information for an account. Mount `kyc` for a complete KYC or KYB flow backed by the Verifications API.
21
+ */
22
+ verifications: { create(options: VerificationsOptions): VerificationsHandle } & VerificationsStatics;
23
+ /**
24
+ * 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 `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. A setup-mode checkout configuration mounts the same element as a payment-method save: nothing is charged, the buyer’s method is stored for you to charge later, and the finished checkout redirects with `setup_intent_id`. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
20
25
  */
21
26
  checkout: { create(options: CheckoutOptions): CheckoutHandle } & CheckoutStatics;
22
27
  /**
@@ -24,15 +29,15 @@ export interface Whop {
24
29
  */
25
30
  ads: { create(options: AdsOptions): AdsHandle } & AdsStatics;
26
31
  /**
27
- * An account's tracked audience: everyone its pixel has seen, and every event they performed. Scope it to an account with `accountId`, then mount `people`, `events`, or both — they read the same window and the same credit rule, so two surfaces side by side can never disagree about what they are showing. `links` wires their person links to your own pages.
32
+ * An account's tracked audience: everyone its pixel has seen, and every event they performed. Scope it to an account with `accountId`, then mount `people`, `events`, or both. They read the same window and the same credit rule, so two surfaces side by side can never disagree about what they are showing. `person` is where a click on either of them leads: one person's whole record, mountable inline or presentable over your page. `links` wires their person links to your own pages.
28
33
  */
29
34
  tracking: { create(options: TrackingOptions): TrackingHandle } & TrackingStatics;
30
35
  /**
31
- * Drives an account's money surfaces. `actions` renders the Deposit, Accept, and Send controls from Whop's balance dashboard: Deposit and Send open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `send` moves money to a recipient or creates a public claim link; `withdraw` collects a payout request; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` lists issued cards; and `activity` lists ledger movements. Every data-backed surface but `deposit` can use the viewer's session when no token is provided.
36
+ * Drives an account's money surfaces. `required-actions` is the outstanding-action bar from Whop's balance dashboard. `actions` renders the Deposit, Accept, Send, and Convert controls: Deposit, Send, and Convert open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `convert` swaps USD with Gold or Bitcoin and exposes FX currencies when the host enables `fxEnabled`; `send` moves money to a recipient or creates a public claim link; `withdraw` lists payout methods and creates the payout when the host does not already drive that API; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` is the compact issued-card list; `cardsTable` renders the full sortable card roster; `cardsChart` plots card spend; `whopCard` renders one revealable card; `activity` lists ledger movements; `activityDetail` renders a prefetched movement, or retrieves one by activity ID or card transaction ID, in a standalone drawer; and `verification` is the identity-only nudge. Every data-backed surface can use the viewer's session when no token is provided.
32
37
  */
33
38
  wallet: { create(options: WalletOptions): WalletHandle } & WalletStatics;
34
39
  /**
35
- * An account's websites: every site built on whop.app plus every domain the Whop Pixel reports, with traffic and attributed revenue per domain. Mount `websites` and it lists them with visitors, page views, sales, revenue, trend, and most-viewed pages. Mount `pixel-setup` alongside it and a site whose pixel the wizard just proved live gets a waiting row automatically, because its first events take a few minutes to reach the stats API and the site would otherwise look lost — you wire nothing up for that, and the row is kept on your page so it is still there if the merchant reloads. Reading stats is privileged, so it needs an `accessToken` — except inside Whop's own app, where the viewer's session carries the read.
40
+ * An account's websites: every site built on whop.site plus every domain the Whop Pixel reports, with traffic and attributed revenue per domain. Mount `websites` and it lists them with visitors, page views, sales, revenue, trend, and most-viewed pages. Mount `pixel-setup` alongside it and a site whose pixel the wizard just proved live gets a waiting row automatically, because its first events take a few minutes to reach the stats API and the site would otherwise look lost — you wire nothing up for that, and the row is kept on your page so it is still there if the merchant reloads. Reading stats is privileged, so it needs an `accessToken` — except inside Whop's own app, where the viewer's session carries the read.
36
41
  */
37
42
  websites: { create(options: WebsitesOptions): WebsitesHandle } & WebsitesStatics;
38
43
  }
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { FrameworkGlobals, WhopElementsLocale } from "./_framework.js";
2
2
  import type { PaymentsHandle, PaymentsOptions, PaymentsStatics } from "./payments.js";
3
+ import type { VerificationsHandle, VerificationsOptions, VerificationsStatics } from "./verifications.js";
3
4
  import type { CheckoutHandle, CheckoutOptions, CheckoutStatics } from "./checkout.js";
4
5
  import type { AdsHandle, AdsOptions, AdsStatics } from "./ads.js";
5
6
  import type { TrackingHandle, TrackingOptions, TrackingStatics } from "./tracking.js";
@@ -12,11 +13,15 @@ export interface WhopGlobalConfig extends FrameworkGlobals {}
12
13
  /** The configured instance: one accessor per namespace, each carrying `create()` plus that namespace's static actions. */
13
14
  export interface Whop {
14
15
  /**
15
- * Collect a payment from a `plan_` ID or inline currency and amount. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's `client_secret` to `handleNextAction` for any pending step.
16
+ * Browse account payments with PaymentsElement, collect a payment from a `plan_` ID or inline currency and amount, or save a payment method without charging with `mode: "setup"`. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's or setup intent's `client_secret` to `handleNextAction` for any pending step.
16
17
  */
17
18
  payments: { create(options: PaymentsOptions): PaymentsHandle } & PaymentsStatics;
18
19
  /**
19
- * 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 `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
20
+ * Collects and verifies identity information for an account. Mount `kyc` for a complete KYC or KYB flow backed by the Verifications API.
21
+ */
22
+ verifications: { create(options: VerificationsOptions): VerificationsHandle } & VerificationsStatics;
23
+ /**
24
+ * 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 `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. A setup-mode checkout configuration mounts the same element as a payment-method save: nothing is charged, the buyer’s method is stored for you to charge later, and the finished checkout redirects with `setup_intent_id`. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
20
25
  */
21
26
  checkout: { create(options: CheckoutOptions): CheckoutHandle } & CheckoutStatics;
22
27
  /**
@@ -24,15 +29,15 @@ export interface Whop {
24
29
  */
25
30
  ads: { create(options: AdsOptions): AdsHandle } & AdsStatics;
26
31
  /**
27
- * An account's tracked audience: everyone its pixel has seen, and every event they performed. Scope it to an account with `accountId`, then mount `people`, `events`, or both — they read the same window and the same credit rule, so two surfaces side by side can never disagree about what they are showing. `links` wires their person links to your own pages.
32
+ * An account's tracked audience: everyone its pixel has seen, and every event they performed. Scope it to an account with `accountId`, then mount `people`, `events`, or both. They read the same window and the same credit rule, so two surfaces side by side can never disagree about what they are showing. `person` is where a click on either of them leads: one person's whole record, mountable inline or presentable over your page. `links` wires their person links to your own pages.
28
33
  */
29
34
  tracking: { create(options: TrackingOptions): TrackingHandle } & TrackingStatics;
30
35
  /**
31
- * Drives an account's money surfaces. `actions` renders the Deposit, Accept, and Send controls from Whop's balance dashboard: Deposit and Send open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `send` moves money to a recipient or creates a public claim link; `withdraw` collects a payout request; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` lists issued cards; and `activity` lists ledger movements. Every data-backed surface but `deposit` can use the viewer's session when no token is provided.
36
+ * Drives an account's money surfaces. `required-actions` is the outstanding-action bar from Whop's balance dashboard. `actions` renders the Deposit, Accept, Send, and Convert controls: Deposit, Send, and Convert open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `convert` swaps USD with Gold or Bitcoin and exposes FX currencies when the host enables `fxEnabled`; `send` moves money to a recipient or creates a public claim link; `withdraw` lists payout methods and creates the payout when the host does not already drive that API; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` is the compact issued-card list; `cardsTable` renders the full sortable card roster; `cardsChart` plots card spend; `whopCard` renders one revealable card; `activity` lists ledger movements; `activityDetail` renders a prefetched movement, or retrieves one by activity ID or card transaction ID, in a standalone drawer; and `verification` is the identity-only nudge. Every data-backed surface can use the viewer's session when no token is provided.
32
37
  */
33
38
  wallet: { create(options: WalletOptions): WalletHandle } & WalletStatics;
34
39
  /**
35
- * An account's websites: every site built on whop.app plus every domain the Whop Pixel reports, with traffic and attributed revenue per domain. Mount `websites` and it lists them with visitors, page views, sales, revenue, trend, and most-viewed pages. Mount `pixel-setup` alongside it and a site whose pixel the wizard just proved live gets a waiting row automatically, because its first events take a few minutes to reach the stats API and the site would otherwise look lost — you wire nothing up for that, and the row is kept on your page so it is still there if the merchant reloads. Reading stats is privileged, so it needs an `accessToken` — except inside Whop's own app, where the viewer's session carries the read.
40
+ * An account's websites: every site built on whop.site plus every domain the Whop Pixel reports, with traffic and attributed revenue per domain. Mount `websites` and it lists them with visitors, page views, sales, revenue, trend, and most-viewed pages. Mount `pixel-setup` alongside it and a site whose pixel the wizard just proved live gets a waiting row automatically, because its first events take a few minutes to reach the stats API and the site would otherwise look lost — you wire nothing up for that, and the row is kept on your page so it is still there if the merchant reloads. Reading stats is privileged, so it needs an `accessToken` — except inside Whop's own app, where the viewer's session carries the read.
36
41
  */
37
42
  websites: { create(options: WebsitesOptions): WebsitesHandle } & WebsitesStatics;
38
43
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // <define:__WHOP_ELEMENTS_LOCALES__>
2
- var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "it", "fr", "ja", "pl", "tr"];
2
+ var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "hu", "it", "fr", "ja", "pl", "tr"];
3
3
 
4
4
  // ../../packages/elements-codegen/src/cli/build/npm-loader.ts
5
5
  var ORIGIN = "https://js.whop.cloud";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whop/elements",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Whop Elements — vanilla-js loader + types. Loads the hosted SDK and exposes the typed WhopElements factory.",
5
5
  "keywords": [
6
6
  "checkout",
@@ -40,6 +40,14 @@
40
40
  "types": "./payments.d.cts"
41
41
  }
42
42
  },
43
+ "./verifications": {
44
+ "import": {
45
+ "types": "./verifications.d.ts"
46
+ },
47
+ "require": {
48
+ "types": "./verifications.d.cts"
49
+ }
50
+ },
43
51
  "./checkout": {
44
52
  "import": {
45
53
  "types": "./checkout.d.ts"
@@ -81,5 +89,5 @@
81
89
  }
82
90
  }
83
91
  },
84
- "whopElementsApiHash": "264824707d32bdd5fc8a44718baa5f440c771bb22528f2e5b50391b1e5b80366"
92
+ "whopElementsApiHash": "643973a360d415d99bd6cf95211709b03ca2dc4b79002d7cd3539f367cd4ca71"
85
93
  }