Browser extension
The consumer side of the rail — an MV3 adaptor that auto-pays x402 paywalls and tips creators on the user's behalf.
What gets metered
a paid fetch — the extension's service worker hosts a PayerAgent; fetchWithPaywall sends a signed proof and, on a 402 Payment Required, grants on-chain and retries once. It's the payer for everything the creator-side integrations meter.
- Who pays: the user — signing via a browser wallet (EIP-1193) or a managed, cap-bounded session account (never a raw key in code)
- Who gets paid: whichever creator the visited resource meters — the extension pays, the facilitator settles to the creator sidecar's payee
Attach surface — no fork
Nothing on any platform at all — this is Pattern 6, the consumer/payer-side adaptor. Three modes: bundle it as a library, message one installed host extension (chrome.runtime.onMessageExternal), or use the injected window.universalPaywall page bridge.
Quickstart
Bundle it, or talk to the installed host extension from any other extension:
// library mode — your extension's background service worker:
import { createPayerAgent } from '@universal-paywall/agent'
const agent = createPayerAgent({
rpcUrl, chainId, account, // injected account — never a raw key
stakeVaultFactory: '0x…', usdc: '0x…',
})
const res = await agent.fetchWithPaywall(url, init)
// host/bridge mode — from ANY other extension:
chrome.runtime.sendMessage(UP_EXTENSION_ID,
{ type: 'up:fetch', url, init }, // → paid Response back
(paidResponse) => { /* … */ })
All values above are placeholders — supply your own facilitator, wallets, and rate.
The shared prerequisites (a deployed StakeVaultFactory, a running
facilitator, a wallet registry) are covered in the admin overview.
Verify
npm run e2e:anvil -w @universal-paywall/extension Drives the real payer loop through the extension handler + bridge against a real x402 resource: upFetch → 402 → auto vault/deposit/grant → 200 → facilitator settle → creator paid 50000 on-chain.
Notes & caveats
Links
- Recipe:
packages/integrations/deploy/browser-extension/README.md— the authoritative attach instructions in the repo. - Extension package (packages/extension, MV3)
- Testing plan — browser-extension row
- Integration Playbook — how integrations like this one are built.
- Testing plan — this platform's row in the L1→L4 matrix.