kit.onramp.mountIframeembeds the widget as an inline<iframe>inside a container element you own. Use this when you have room in your layout for a 720+ pixel-tall surface.kit.onramp.openWindowlaunches the widget as a separate popup window. Use this when inline embedding does not fit your UX, when iOS Safari’s storage restrictions block the iframe flow, or when you want the widget to feel separate from your app.
When to pick each mode
iOS Safari’s Intelligent Tracking Prevention can restrict storage inside a
cross-origin iframe, which sometimes breaks the embedded app’s session handling.
If you see issues isolated to iOS Safari, use
openWindow on that platform.
Iframe mode
mountIframe does not require a user gesture. You can call it on page load,
from your framework’s mounted lifecycle, or after any await. The container
element must already be attached to the document and must have an explicit,
non-zero height:
TypeScript
Popup mode
openWindow must be called synchronously from a user gesture (a click
handler, for example). If you await before calling, the browser blocks the
popup because the user-gesture context has expired.
Mint the session ahead of time, then call openWindow directly from the click
handler:
TypeScript
openWindow returns a discriminated result rather than throwing, so a blocked
popup is a normal flow you handle in code, not an exception.
Handle a blocked popup
WhenopenWindow cannot open a usable popup, it returns
{ status: 'blocked', reason }. The reason field tells you why, and what to
do about it:
Example with all three fallbacks:
TypeScript
Popup behavior on mobile
On mobile browsers,window.open opens a new tab rather than a sized popup. The
width and height features are ignored. Design your UX for both outcomes.
Popup closed before deposit
If the user closes the popup before submitting a deposit, the App Kit SDK detects it and synthesizes aDEPOSIT_NOT_COMPLETED event with code
CANCELED_BY_CUSTOMER. Your onDepositNotCompleted handler runs without any
extra polling on your side.
Close the widget
BothmountIframe and openWindow return a controller with a close() method.
Call it when the user leaves the view, closes the modal, or starts over:
TypeScript
close() call. Call widget.close() when you know the
widget is no longer needed.