onExit fires when the shopper leaves a launched surface without completing it: the wallet sheet is dismissed without authorizing, or the bank-linking modal is closed. It is the dedicated channel for “shopper dismissed something”, distinct from an error.
Emitted by applePay, googlePay, bank (Plaid mode), and checkout (when its active sub-method is one of those). Every other element omits the key from its event map; subscribing is a TypeScript error and a runtime no-op (with a console warning).
onExit is not an error
onError is reserved for genuine failures (validation, tokenization, network, vendor errors). Shopper abandonment fires onExit only. Wallets and bank deliberately suppress the corresponding onError envelope when the underlying provider reports a cancellation or exit.
Payload
Wallets:Example (wallet)
Example (bank)
plaidMetadata is always populated when the shopper leaves the linking modal. plaidError is populated only when they exited after hitting an in-flow error (for example, an invalid-credentials attempt):
plaidError is present, the SDK additionally fires onError with code: 'plaid_link_failed' (deduplicated so consumers do not see multiple envelopes for the same underlying failure). Subscribing only to onExit still gives you the full context via plaidError.
Example (Checkout)
Elements that do not emit onExit
card, standalone inputs (email, phone, fullName, address elements, custom elements), and submitButton never fire onExit. Their event maps omit the key.