Repository navigation
Add a branded card capture page for Kernel wallets - #3
Open
hiroTamada wants to merge 2 commits into
Open
hiroTamada wants to merge 2 commits into
hiroTamada wants to merge 2 commits into
Conversation
hiroTamada
marked this pull request as ready for review
November 17, 2026 20:05
yummybomb
requested changes
Nov 17, 2026
There was a problem hiding this comment.
i’d fix two token-handling cases in app/cards/add/card-capture-page.tsx:62-67 before merging:
- Switching links in the same tab: If a second enrollment link changes only the fragment, the page stays mounted and the form keeps the first token. If that enrollment is still open, saving the card completes the first enrollment, not the second.
- Opening a valid link in
next dev: Strict Mode runs the mount effect twice. The first run reads the token and clears the fragment; the second reads the empty fragment and overwrites the token withnull, so the user sees “This link is incomplete.”
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.
Summary
Adds a card enrollment example alongside the credential flows: a branded
/cards/addpage that rendersKernelCardCapturefrom@onkernel/vault-react0.5.0, and a script that prints a capture link for it.app/cards/add: reads the capture token from the URL fragment, removes it from the address bar, and renders the component with custom copy. It styles all three layers: page CSS through the class hooks,fieldCssfor VGS inputs, andevervaultThemefor Evervault's iframe, so the same page works whichever card vault the organization uses.scripts/create-card-link.ts(bun run create-card-link -- <vault-name> [wallet-key]): upserts the vault and aprovider: "kernel"wallet, runsadd_payment_method, and prints/cards/add#token=....lib/capture-token.ts: validates the<payment-method-id>.<secret>token format./cards/addgets the same no-store, no-referrer, nosniff and frame-deny headers as the credential page.@onkernel/vault-reactto^0.5.0(0.1.0 can't render Evervault cards) and@onkernel/sdkto^0.148.0(0.122 has noadd_payment_methodoperation). The credential flows are unchanged and their tests still pass.Testing
bun run typecheck,bun run test(26 pass, including new tests for the token parser and the page),bun run buildcreate-card-linkcreated a link, and/cards/addloaded in headless Chromium with the token cleared from the URL,GET /vault/card-captures/currentreturning 200, and Evervault's card fields rendered with the custom theme. No card was submitted. The test vault was deleted afterwards.