Skip to main content

Webview Base URL

All iframe integrations point to this hosted webview. You append query parameters to configure which widget to display and how to connect to the Pods API.

Iframe URL Query Parameters

URL Builder Example


postMessage Protocol

The iframe and wrapper communicate via window.postMessage. The protocol is typed in TypeScript below — copy this into your project as src/types/postmessage-protocol.ts.

Shared Types

Message Directions

Type Guards


processBytecode Flow via postMessage

The iframe version of processBytecode works over postMessage instead of in-process callbacks. The transaction lifecycle statuses and error handling are the same as the widget processBytecode — the only difference is the transport: messages are wrapped in { kind: 'TX_STATUS_UPDATE', payload } and sent via postMessage instead of calling ctx.updateTxStatus() directly.

Happy Path

Error Paths

See processBytecode — Error Handling for the full list of error statuses (SIGNATURE_DECLINED, SIGNATURE_ERROR, TX_REVERTED).

Listening for postMessage Events

The wrapper must listen for message events on window and filter using the type guards from the protocol types:

Iframe HTML Element

No iframe should be present in the DOM before the smart account is ready. Show a loading state or placeholder instead.

Wrapper Implementations

We provide two reference wrapper implementations, each targeting a different wallet/auth stack:

wagmi + viem

Browser wallet (MetaMask) with ERC-4337 smart accounts via permissionless. Single-chain (Polygon).

Privy

Privy authentication (email OTP) with embedded smart wallets. Multi-chain support (6 chains).

LLM Resources

Use these resources to generate iframe wrapper projects with AI assistants.

One-Shot Prompts