v2026.06.10 feat(options): Shopify Admin Access Token Generator - #67
Open
junaidkbr wants to merge 2 commits into
Open
v2026.06.10 feat(options): Shopify Admin Access Token Generator#67junaidkbr wants to merge 2 commits into
junaidkbr wants to merge 2 commits into
Conversation
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 #47
What
Automates the Shopify Admin OAuth flow from inside the browser. A new Access Tokens page in the options app lets you enter a custom app's credentials, pick scopes from a searchable checklist (with quick-select bundles), and generate an Admin API access token without Postman or manual URL construction.
How it works
/admin/oauth/authorizeURL with a randomstateparam, saves a pending session (local:oauth_pending_session), and opens the approval tab.webNavigation.onBeforeNavigate: this fires before any connection attempt, so the?code=is captured even when the redirect URI ishttp://localhost/with nothing listening.stateparam is validated (CSRF guard + proof the navigation is our callback; unrelated navigations and forged callbacks are ignored without disturbing the in-flight session)./admin/oauth/access_token(CORS-free thanks to existing<all_urls>host permissions), saves the token to the vault, deletes the pending session, and redirects the tab back to the options page with the outcome.local:access_tokens) lists tokens by store with granted scopes and age; one-click copy, per-token delete, and delete-all. The options page updates reactively viastorage.watch.Security
Scope (v1, per discussion)
Core flow + token vault, options page only. Deferred to follow-ups: user-saved scope presets, Partner Dashboard credential auto-detect, context-menu trigger.
Changes
utils/oauth.ts: shared types, session/vault storage, URL build/parse, token exchangeutils/adminScopes.ts: static Admin API scope registry + quick-select bundlesentrypoints/background/oauth.ts: redirect capture + exchange state machineentrypoints/options/components/pages/AccessTokens.svelte,access-tokens/TokenGenerator.svelte,access-tokens/TokenVault.svelte: new page UI (Polaris web components)Testing
tsc --noEmit,oxlint,oxfmtclean; productionwxt buildsucceeds