Drop a single <iframe> into your app and your users can load their wallet without you building any payment UI. The hosted flow handles amount selection, payment method (Pay by Bank via Plaid Hosted Link, or card), and confirmation. Your app renders the screen title and exit button; the iframe is the body.
POST /v1/users:upsert on sign-in and store the returned id.Your backend exchanges the API key for a short-lived JWT and passes it to the client as iframeToken. The API key never leaves your server.
// Exchange API key for a short-lived iframe token (10 min)
const { accessToken } = await fetch(
`${UPTOP_API_BASE}/v1/users/${userId}/auth/client-token`,
{ method: 'POST', headers: { 'Api-Key': process.env.UPTOP_API_KEY } }
).then(r => r.json());
// Return accessToken to the client — never the raw API key
return { iframeToken: accessToken };Try it — fetch a token to activate the live preview:
Set your API Key and User ID in settings to fetch a token.
<iframe
src="https://insomniac-docs.uptop.xyz/embed/add-funds?userId={USER_ID}&iframeToken={TOKEN}"
width="390"
height="844"
style="border:none;"
allow="payment"
></iframe>No preview
Set your API Key and User ID in settings, then fetch a token in the Authentication section.