Skip to main content
Load the Daimo deposit UI inside any native WebView (iOS WKWebView, Android WebView, or a plain react-native-webview). There’s no SDK to install: create a session and construct a URL.
On React Native, prefer DaimoFrameRN from @daimo/sdk, which handles sizing, dismissal, and deeplink hand-off for you. Use this guide when you can’t add the SDK, or you’re on native iOS / Android.

How it works

  1. Create a session via the API
  2. Construct the webview URL from the session ID and client secret
  3. Load that URL in your native WebView
  4. Listen for postMessage events to track payment progress

Create a session

Then construct the webview URL from the response:

Load the WebView

iOS (Swift)

Android (Kotlin)

React Native (without the SDK)

Query parameters

Handle events

The WebView sends messages via postMessage. The message format:
paymentStarted and paymentCompleted are notifications only; the payload object is empty. In layout=embed, contentHeightChanged includes { "height": number } in CSS pixels. To get full session details (tx hash, chain, amounts, etc.) after any payment event, poll GET /v1/sessions/{sessionId}.

Fit embedded height

When you load the webview inside your own modal or bottom sheet, add layout=embed and size the host container to the reported content height. This avoids showing a full-screen webview with empty space below the deposit UI.
Only layout=embed sends contentHeightChanged. In React Native, store that height and apply it to the WebView:

Center full-height WebViews

When the WebView itself fills the screen, add layout=center to center the deposit UI in a full-height themed WebView shell:
This mode does not send contentHeightChanged; the host WebView should own the full available height.

Theming

Set your org theme in the Daimo dashboard to match the hosted deposit UI to your brand. The WebView loads it automatically from the session. Choose Automatic, Light, or Dark in dashboard customization to control the default active mode. Pass theme=light or theme=dark to override it for a specific WebView. See Customization for the dashboard flow and token list.

sendToHost protocol

The webview page communicates with the host container via a sendToHost function that tries three transport layers in order:
  1. React Native / Expo: window.ReactNativeWebView.postMessage(JSON.stringify(msg))
  2. iOS / macOS WKWebView: window.webkit.messageHandlers.daimoPay.postMessage(msg)
  3. Browser iframe / desktop WebView: window.parent.postMessage(msg, "*")
All messages share a common envelope: