Skip to main content
The Deposit class emits events during the deposit flow. Use on() and off() to subscribe and unsubscribe.

Events

complete

Fired when the payment completes successfully. The handler receives a DepositResult.

error

Fired when the deposit flow fails. The handler receives a DepositError.

close

Fired when the transfer iframe is dismissed (user tapped backdrop, pressed Escape, or the flow was closed programmatically).

status-change

Fired on every status transition. The handler receives the new DepositStatus.

resize

Fired only when the resolved presentation is embedded. Blink reports the rendered content height and its width design envelope. The SDK has already resized the inline iframe; use this event when your outer panel should follow it.
Do not apply a CSS transition to reported height changes. Blink already animates its internal height. Width may transition because the width hints are stable values.
No resize event fires for the overlay presentation, including when an embedded request resolves to the overlay on mobile. See Embed Blink in an aggregator.

Status transitions

Subscribing and unsubscribing

Both on() and off() return this for chaining:

Lifecycle management

close()

Closes the transfer iframe and resets status to idle. Fires the close event. Does not destroy the instance. You can call requestDeposit() again. If a flow is active, close() also rejects its pending requestDeposit() promise with DEPOSIT_DISMISSED. This lets an embedded host handle its own back button and Blink’s dismissal through one error branch.

destroy()

Closes the iframe, removes all event listeners, and marks the instance as destroyed. Subsequent calls to requestDeposit() will reject with INVALID_REQUEST. Call this when the component unmounts or the page unloads.
Always call destroy() when the transfer is no longer needed to prevent memory leaks from lingering event listeners.

React lifecycle

The useBlinkDeposit hook manages the Deposit instance lifecycle automatically:
  • Creates the instance on first render.
  • Subscribes to status-change, complete, and error events.
  • Cleans up all subscriptions and calls destroy() on unmount.
You do not need to call destroy() manually when using the React hook.