Skip to main content
Onramp and Pay Links both hand off from a web page to a Lightning wallet on the user’s phone through a deep link. The three browser-side patterns the handoff needs: opening the wallet reliably, tracking the order without leaking your API key, and showing the user what stage their payment is in.

Live example

flashnet-onramp-example.vercel.app

Source code

github.com/flashnetxyz/pay-link-example

How do I open the Lightning app?

The Cash App payment URL is a deep link. It only works when the browser navigates to it. A fetch() call just downloads the HTML response and nothing visible happens. Wrong:
Right:
The same rule applies to Strike, Wallet of Satoshi, and any other Lightning app that handles a universal link. Navigate to the URL; do not fetch it.

How do I track order status with SSE?

Use Server-Sent Events for live order tracking. Connect through your proxy so the API key stays server-side. Close the connection only on completed, failed, or refunded. The server keeps the stream open on unfulfilled because a late deposit can revive the order; keep the stream open (or resubscribe) so you catch the resumption. Fall back to polling every 3 seconds if SSE disconnects.
Proxy SSE through your backend. The browser should never see your API key. Detect /v1/sse/ paths in your proxy and stream the response with text/event-stream headers.

How do I proxy the API key?

Keep the API key on the server. The browser calls your proxy, the proxy attaches the Authorization header, and the response streams back. For SSE paths, the proxy streams the upstream body as-is with text/event-stream headers so the browser keeps the connection open.

How do I show pipeline progress?

Orders move through a sequence of statuses. Surface the current stage so the user knows the payment is working. Use the SSE status events to animate transitions between stages. The live example shows a step-by-step pipeline visualization with a countdown timer.