Skip to main content
Every element exposes the same six core events: onReady, onChange, onSubmit, onError, onFocus, and onBlur. Non-wallet elements additionally expose onEscapeKeyPressed. Wallet elements (applePay, googlePay) and Checkout expose onClick. Wallet elements, bank, and Checkout expose onExit.

Subscribing

Every element handle exposes .on(name, handler) returning the same handle for chaining:
Every payload includes elementType. Payloads are discriminated by elementType, so a single handler that receives an event from any element narrows correctly.

Event matrix

Elements that do not emit a given event omit the key from their event map, so subscribing is a TypeScript error and a runtime no-op (with a console warning).

Payload envelope

Every payload extends a base:
Per-event extras layer on top:
  • onChange adds complete, value, and (optionally) errors. Wallets and Checkout add extras (device availability, method availability).
  • onSubmit adds value (non-null by construction).
  • onError adds code, message, and (optionally) fieldErrors and cause.
  • onClick (wallets and Checkout) adds preventDefault, resolve, reject. Checkout additionally adds paymentMethod.
  • onExit (bank and Checkout) adds Plaid metadata or the paymentMethod discriminator.

complete versus value !== null versus errors.length === 0

These three look interchangeable but are not: Always drive submit-button state off complete. It is the only flag whose semantics are consistent across every element, including wallets and Checkout.

See also

Last modified on July 17, 2026