This project supports both standards-level MPP testing and the JWT cookie shortcut used by the proxy.
- A Tempo test wallet private key
- Test tokens in that wallet
- The Worker running locally:
npm run devPRIVATE_KEY=0x... npm run test:clientThe script will:
- Request
/__mpp/protectedand confirm a402 Payment Required - Inspect the
WWW-Authenticate: Paymentchallenge - Use
mppxto complete the payment automatically - Verify a
Payment-Receiptis returned - Reuse the issued
auth_tokencookie without paying again
curl http://localhost:8787/__mpp/healthcurl -i http://localhost:8787/__mpp/protectedYou should see:
402 Payment RequiredWWW-Authenticate: Payment ...Cache-Control: no-store
npx mppx account create
npx mppx http://localhost:8787/__mpp/protectedAfter a successful paid request, copy the auth_token cookie and retry:
curl http://localhost:8787/__mpp/protected \
-H "Cookie: auth_token=<token>"PRIVATE_KEY- required Tempo wallet private keySERVER_URL- optional, defaults tohttp://localhost:8787
- The built-in script uses
mppx/clientwith the Tempo method. - The proxy still uses cookies after payment so repeat browser requests stay cheap.
- Never test with a wallet that holds real funds.