Skip to main content
Before you install anything, it helps to understand the shape of the SDK: the stages a payment moves through, how the runtime plugs into your app, and why your Engine API key never reaches the browser.

The payment lifecycle

Whatever UI you build, the runtime moves a payment through the same stages. Your job is to render each stage and call the matching action.

Load the payment

The buyer arrives with a payment ID (from a QR code, link, or your checkout). The runtime fetches the payment intent — amount, merchant, accepted tokens.

Connect a wallet

The buyer connects a wallet through the WalletProvider seam. The runtime reads their accounts across the supported networks.

Fetch payment options

Given the connected accounts, the Engine returns the concrete ways to pay — token, network, amount, fees, and whether compliance data is required.

Select & build

The buyer picks an option. The runtime builds the transaction(s) and the exact wallet-RPC actions to sign.

Sign

The Signer drives the wallet through the required signatures (e.g. a permit + the payment).

Confirm & settle

Signed results are submitted to confirm the payment. The runtime then polls status until the payment succeeds, fails, or expires.

How it fits together

The Headless SDK follows a headless runtime + host model. The payment flow lives entirely in the SDK; your application is the host that consumes it. The runtime reaches the outside world only through five injectable seams — so you can swap in your own transport, wallet, timing, and analytics, and reuse the exact same payment machine. The five seams the runtime depends on:
SeamWhat it abstractsProvided by
TransportEngine HTTP callspay-core createHttpTransport → your server route
WalletProviderconnect / accounts / provider / switchpay-appkit, or your own wallet integration
Signersign a payment option’s wallet-RPC actionspay-state signing strategies over the wallet seam
Clockintervals + page visibility (for polling)browser timers (the SDK ships a default)
Telemetryanalytics breadcrumbsyour analytics pipeline (optional)
@walletconnect/pay-state ships browser-ready Clock and Telemetry defaults (browserClock, noopTelemetry). In practice a React/Next.js gateway wires three seams itself — a Transport (pointed at your server route), a WalletProvider (the AppKit adapter), and a Signer (built from the wallet) — and reuses browserClock for the rest. Telemetry is optional.

The Engine API key never reaches the browser

WalletConnect Pay’s Engine API is authenticated with a secret API key that must stay server-side. The SDK enforces this split: the browser talks to your server, and your server talks to the Engine. pay-core exposes two entry points for exactly this: createHttpTransport for the browser (talks to your server) and createEngineClient (imported from @walletconnect/pay-core/server) which holds the API key and talks to the Engine. In a Next.js app, your Route Handler sits in the middle.

Next steps

Implementation

Build a complete checkout in React / Next.js, step by step.

Packages Reference

The public API of pay-core, pay-state, pay-react, and pay-appkit.