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 (address-lookup 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:
Bank (address-lookup mode):
Checkout:
Example (wallet)
Example (bank)
linkMetadata is always populated when the shopper leaves the linking modal. linkError is populated only when they exited after hitting an in-flow error (for example, an invalid-credentials attempt):
When linkError 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 linkError.
Example (Checkout)
Naming rationale
onExit describes leaving a launched experience, not cancelling an in-flight operation. The shopper backs out of a sheet they themselves opened; there is no transaction to cancel. onCancel is intentionally reserved for any future “abort an in-progress action” semantic.
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.
See also
Last modified on July 17, 2026