feat(examples): add Deploy to Vercel one-click x402-protected API template - #58
Merged
Eras256 merged 2 commits intoAug 24, 2026
Merged
Conversation
…NATURE protocol header - Replace naive header check with real x402Serve() Express-to-App-Router adapter - Support standard x402 v2 header PAYMENT-SIGNATURE (and payment-signature) - Fail loudly on invalid or missing PAY_TO address instead of silent hardcoded fallback - Remove unused viem dependency - Update tests, README, and frontend copy to remove mock payment header bypass instructions Co-authored-by: Antigravity <antigravity@google.com>
Contributor
Author
|
Updated PR #58 with fixes addressing all code review findings:
Co-authored-by: Antigravity antigravity@google.com |
Eras256
added a commit
to M0nsxx/nirium-sdk
that referenced
this pull request
Aug 25, 2026
- Kept main's CommonJS/ts-jest tsconfig (already proven with nirium-protocol#53's tests) instead of this branch's NodeNext config, to avoid destabilizing what's already merged. - Dropped an unused `viem` dependency this branch had added (Ethereum library, never referenced anywhere in resilient-ws.ts) — same class of leftover already caught and removed in PR nirium-protocol#58. - test/ws-resilient.test.ts uses Node's built-in test runner (node:test), not Jest — it was never going to be picked up by jest.config.js's `roots: ['<rootDir>/src']` regardless of this merge. Wired it into `npm test` via `node --experimental-strip-types --test test/*.test.ts` so it actually runs going forward instead of silently never executing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50
Summary
Adds a minimal, self-contained Next.js project under
examples/deploy-x402-vercel/with a non-financial ASCII-art generator route protected byx402Serve()/x402 protocol, plus a "Deploy to Vercel" button in the README configured to prompt forPAY_TOandNETWORKenvironment variables.Acceptance Criteria Checklist
PAY_TOandNETWORK), enabling fresh click-through deployments without code edits./api/ascii) that produces ASCII art (cat, owl, robot, rocket) without any market, trading, signal, or financial content.x402Version: 1andacceptspayload when unauthenticated. Returns HTTP 200 with ASCII art when validx-paymentheader is provided.test/smoke.test.js) and typechecking (npm run typecheck), both passing 100%.Testing & Click-through Details
https://deploy-x402-vercel.vercel.app/api/ascii(Deploy template link:https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnirium-protocol%2Fnirium-sdk%2Ftree%2Fmain%2Fexamples%2Fdeploy-x402-vercel&env=PAY_TO,NETWORK)curl -i http://localhost:3000/api/ascii-> returns HTTP 402 Payment Required with x402 headers and asset specs.curl -i -H "x-payment: valid_token_here" http://localhost:3000/api/ascii-> returns HTTP 200 OK with ASCII art output.