Repository navigation
feat: add Clerk sign-in and account order history - #35
Closed
jack-arturo wants to merge 1 commit into
Closed
jack-arturo wants to merge 1 commit into
jack-arturo wants to merge 1 commit into
Conversation
Add an extension account page for sign-in, sign-up, sign-out, and a typed order-history source with sample data until a real endpoint is configured. Theme Clerk to Browser Hand and keep keys in env only. Also remove a duplicate TabManager field so the extension typecheck passes. Co-authored-by: Jack Arturo <info@verygoodplugins.com>
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 optional Clerk sign-in on top of Browser Hand. The toolbar popup still controls the local relay with or without an account. Sign-in, sign-up, sign-out, the account summary, and order history live on an extension page (
account.html) opened from the popup.No Clerk application or keys are in the repo. Setup is documented in the README and
.env.example.Changes
@clerk/chrome-extension(ClerkProvider,SignIn,SignUp,UserButton,UserProfile) with Browser Hand appearance: ink#0B0A12, bone, cyan#7EE7FF, and the glove mark.chrome.storagesnapshot (no tokens) and opens the account page. The background relay is unchanged and is not gated on sign-in.extension/account/orders.ts): sample orders untilWXT_ORDER_HISTORY_URLis set, then a bearer-token HTTP source that does not fall back to samples on failure.npm run clerk:brand(@clerk/backend) mergeschrome-extension://<id>into instanceallowed_origins. WithCLERK_APPLICATION_ID, it also calls the Platform API to set the application name to Browser Hand and upload the glove logo.WXT_-prefixed and inlined at build time.CLERK_SECRET_KEYhas noWXT_prefix and is not bundled..envstays gitignored.cookiesis requested only whenWXT_CLERK_SYNC_HOSTis set. Extension-only sign-in usesstorage.debuggerUnavailableReasonfield onTabManager, and loosened two tab-group test assignments sotsc --noEmitis clean.Test plan
cd extension && npm run test:run— 107 tests passedcd extension && npx tsc --noEmitcd extension && npm run build— succeeds with no.envCLERK_SECRET_KEYandWXT_CLERK_PUBLISHABLE_KEY: the secret is absent fromdist/; the publishable key is inlined only in the account chunknode extension/scripts/clerk-brand.mjs --dry-runplanschrome-extension://<id>and makes no API calls; a placeholder secret exits non-zeronpm run doctor— not run; attach, CDP, and the relay were not changed.env, a rebuild, andnpm run clerk:brandNotes for reviewers
Auth is additive. Missing or placeholder keys show setup instructions on the account page; the popup toggle keeps working.
Follow-ups before this can sign anyone in:
.env.exampleto.env. SetWXT_CLERK_PUBLISHABLE_KEYandCLERK_SECRET_KEY. Optionally setWXT_CLERK_FRONTEND_API.npm run build:extensionand reload the unpacked extension.chrome://extensionsinCLERK_EXTENSION_IDand runnpm run clerk:brand.CLERK_APPLICATION_ID(andCLERK_PLATFORM_SECRET_KEYif the Platform API token differs). A 401/403 means set the name and logo in Dashboard → Settings → Branding. In-extension components are themed either way.GETcontract in the README and setWXT_ORDER_HISTORY_URL. Verify the bearer token withverifyTokenand ignore theuserIdquery param as an authority.The popup name stays stale until the account page has loaded once. The account bundle is large because Clerk's UI is bundled; the popup and background worker do not include it.