name: WXT Extension Publishing
description: Step-by-step instructions on how to package and publish a WXT-based browser extension to the Chrome, Firefox, and Edge stores using the wxt submit command.
WXT Extension Publishing
This skill details the correct workflow for initializing authentication credentials and submitting a WXT browser extension to the Chrome Web Store.
1. Google Cloud Console Preparation
To use the automated submission API, you must have an OAuth Client ID configured correctly:
- Go to your Google Cloud Console Credentials Page.
- Click + CREATE CREDENTIALS and choose OAuth client ID.
- CRITICAL STEP: For the Application type, you must select Desktop app (桌面应用). If you select "Web application", the authorization flow will fail with a
redirect_uri_mismatcherror (urn:ietf:wg:oauth:2.0:oobis only allowed for native desktop apps). - Save your Client ID and Client Secret.
2. Initialize Submission Configuration
Run the initialization command interactively:
pnpx wxt submit init
During the prompt:
- Select the stores you want to configure (e.g.,
Chrome Web Store). - Enter your extension ID (found on the Chrome Developer Dashboard).
- Enter your Client ID and Client Secret (created as a "Desktop app" in step 1).
- When asked
Generate new refresh token?, select Yes. - The console will output an authorization URL starting with
https://accounts.google.com/o/oauth2/auth.... - Open the link in a browser, log in with your developer account, and grant access.
- Copy the Auth Code provided on the success page and paste it back into your terminal.
💡 Pro-Tip for Firefox (
FIREFOX_EXTENSION_ID):
If you are configuring Firefox and your Firefox Addon UUID contains curly braces (e.g.,{c8efa7cc-...}), the underlying publishing tool currently has a bug that strips the braces and causes404 Not FoundAPI errors. To fix this, use your extension's URL Slug (e.g.,m10c-web-page-video-to-mindmap) as theFIREFOX_EXTENSION_IDinstead of the UUID.
💡 Note for Edge (
EDGE_PRODUCT_ID,EDGE_CLIENT_ID,EDGE_API_KEY):
For the Edge Addons store, you'll need the Product ID (found at the top of your Edge Developer Dashboard) and API Credentials (Client ID and API Key v1.1). Follow Microsoft's documentation to generate the API credentials in the Partner Center.
This process will successfully write the configurations, including CHROME_REFRESH_TOKEN and EDGE_API_KEY, to a local .env.submit file.
Security Note: Ensure that
.env.submitand.env.submit.backup-*are added to your.gitignoreto prevent leaking tokens.
3. Package the Extension
Before submitting, build and package the extension into a .zip file:
pnpm run zip
# or simply run: wxt zip
The packaged file will be generated in the .output/ folder (e.g., .output/m10c-video-summary-extension-3.0.1-chrome.zip).
4. Submit for Review
Finally, use the wxt submit CLI (which utilizes publish-browser-extension under the hood) to upload the zip to the stores and submit it for review:
# Submit only to Chrome:
pnpx wxt submit --chrome-zip .output/<YOUR_EXTENSION_ZIP_FILE_NAME>-chrome.zip
# Submit to Chrome and Edge:
pnpx wxt submit \
--chrome-zip .output/<YOUR_EXTENSION_ZIP_FILE_NAME>-chrome.zip \
--edge-zip .output/<YOUR_EXTENSION_ZIP_FILE_NAME>-chrome.zip
The CLI will check the ZIP files, fetch the required access tokens/APIs, upload the ZIPs, and automatically submit them for review.