Add Electron desktop wallet example (#341)#346
Open
Kingvic300 wants to merge 2 commits into
Open
Conversation
tsc compiles src/ and react/ together (react/ imports from src/), which made it nest src output under dist/src/* instead of dist/*. package.json's main/types/exports point at dist/index.js etc., so the SDK's main entry point never actually existed in a fresh build — breaking every example that imports '@veil/invisible-wallet-sdk' from the main export.
Runs the Veil web SDK unmodified in an Electron renderer process — register, dashboard, and send flows mirror the vite-react starter. main.cjs serves the renderer over local HTTP (dev server or a built-in static server) since file:// is not a secure context and WebAuthn requires one. README documents the resulting caveats: per-origin localStorage, native OS biometric prompts, and platform-authenticator support differences across macOS/Windows/Linux.
|
@Kingvic300 is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Kingvic300 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
4 tasks
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 #341
Summary
examples/electron/— an Electron desktop wallet example that runs the Veil web SDK unmodified in the renderer process (no native plugin, no IPC bridge for crypto). Register/dashboard/send flows mirror thevite-reactstarter.electron/main.cjsloads the renderer over local HTTP (Vite dev server in dev, a tiny built-in static server in prod) rather thanfile://, since Chromium does not treatfile://as a secure context and WebAuthn requires one.localStorage, native OS biometric prompts, and platform-authenticator differences across macOS/Windows/Linux.sdk/build bug found while verifying this example:tsccompilessrc/andreact/together (required, sincereact/imports fromsrc/), which nests output underdist/src/*instead ofdist/*.package.json'smain/exportspoint atdist/index.js, so that file never actually existed in a fresh build — silently breaking the SDK's main entry point for every example that consumes it (vite-react,tauri, etc.), not just this one. Addedsdk/scripts/flatten-dist.js, wired intonpm run build, to fix this.Test plan
cd sdk && npm install && npm run build— confirmsdist/index.jsnow exists andrequire('./dist/index.js').useInvisibleWalletresolvescd examples/electron && npm install && npm run build— renderer builds cleanlynpm start): Electron boots, serves the built bundle overhttp://localhost:5180, SPA routing/fallback verified (/,/register, asset requests)git stashthat pre-existinguseSendPayment.test.tsxfailures are unrelated to the SDK build fix