Repository navigation
Description
Problem
When a site that integrates Markee has no wallet setup, the embed prompt recommends one. Until now that meant Privy, which makes every integrator sign up for a Privy account and register their domain. We can't let them share Markee's Privy app, because Privy only accepts logins from allowlisted domains and we have no automated way to add every integrator's domain.
The embed prompt now defaults to wagmi's injected() + coinbaseWallet() connectors, which need no accounts and no keys. That covers visitors who have a wallet, or who are willing to create a Coinbase Smart Wallet. It does not match what Privy gives us on markee.xyz: email/social login, an embedded wallet, and card funding.
Proposal: hosted checkout popup on markee.xyz
Markee hosts the checkout, and the integrating site opens it in a popup. It works the way Stripe Checkout does.
integrator site markee.xyz
─────────────── ──────────
trigger card click
└─ window.open('https://www.markee.xyz/checkout/<board>?origin=<site origin>', 'markee-checkout', 'popup,width=480,height=760')
/checkout/<board>
- Markee's own Privy (only markee.xyz needs allowlisting)
- the existing MarkeeSignModal / StreamSignModal UX, full-page
- card funding via Privy useFundWallet
on success:
window.opener.postMessage({ type: 'markee:tx', board, markee, txHash }, origin)
window.close()
window.addEventListener('message', ...)
- check event.origin === 'https://www.markee.xyz'
- refetch leaderboard data with ?bust=1
Scope
-
app/checkout/[address]/page.tsx: a chrome-less page that renders the right sign modal for the board's strategy (fixed / streaming), reusing the existing components. It should not fork them. - Before sending
postMessage, check theoriginquery param against the board's verified integration URLs, so we never send tx details to an arbitrary opener. If the origin can't be verified, still complete the purchase but skippostMessage. The integrator's normal polling will pick up the change. - Message contract:
markee:ready,markee:tx(withtxHash,markee,board),markee:closed. Version it (v: 1). - If popups are blocked, fall back to a full-page redirect with a
return_toparam (checked against the same allowlist). - Embed prompt: add a "Markee checkout (no wallet setup needed)" option to
walletFragmentinfrontend/lib/embedPrompt/fragments.ts, plus a matching choice inWebsiteEmbedWizard. Integrators who pick it skip wagmi/viem entirely. The embed becomes a read-only trigger card, a popup opener, and a message listener. - Mobile: check that popups work in in-app browsers such as X and Telegram, and use the redirect fallback where they don't.
Open questions
- Should views and MARKEE rewards from checkout-popup purchases be credited to the integrating site the same way on-site purchases are?
- Do we want a small script (
<script src="https://www.markee.xyz/embed.js">) that handles opening the popup and listening for messages, so integrators don't have to hand-write it?
Out of scope
- Replacing the fully embedded flow. Sites with their own wallet setup keep building in-page.
Activity