publish-browser-extension v3.0.0
Features
- Publish to the Chrome Web Store, Firefox Addon Store, and Edge Addon Store
- Helper script to generate secrets and configure options
- Upload sources ZIP to the Firefox Addon Store
You are responsible for uploading and submitting an extension for the first time by hand.
publish-browser-extensiondoes not provide tools for creating a new extension.
Install
npm i -D publish-browser-extension
pnpm i -D publish-browser-extension
yarn add -D publish-browser-extensionCLI Usage
To get started, run the init command. It will walk you through generating all the necessary environment variables/CLI flags, saving them to a .env.submit file:
publish-extension initAll CLI flags can be passed as environment variables instead. For example, setting the
CHROME_CLIENT_IDenvironment variable is equivalent to passing--chrome-client-id. Just convert the flag to UPPER_SNAKE_CASE.
Then, just run the submit command, passing the ZIP files you want to submit:
publish-extension \
--chrome-zip dist/chrome.zip \
--firefox-zip dist/firefox.zip --firefox-sources-zip dist/sources.zip \
--edge-zip dist/chrome.zippublish-extesion will automatically look for a .env.submit file and load it if it exists.
JS Usage
import { publishExtension } from 'publish-browser-extension';
publishExtension({
dryRun: true,
chrome: {
zip: 'dist/chrome.zip',
extensionId: '<cws-extension-id>',
clientId: '<gcp-client-id>',
clientSecret: '<gcp-client-secret>',
refreshToken: '<gcp-refresh-token>',
publishTarget: '<default|trustedTesters>',
skipSubmitReview: false,
},
firefox: {
zip: 'dist/firefox.zip',
sourcesZip: 'dist/sources.zip',
extensionId: '<addons-extension-id>',
jwtIssuer: '<addons-jwt-issuer>',
jwtSecret: '<addons-jwt-secret>',
channel: '<listed|unlisted>',
},
edge: {
zip: 'dist/chrome.zip',
productId: "<edge-product-id>",
clientId: "<edge-client-id>",
clientSecret: "<edge-client-secret>",
accessTokenUrl: "<edge-access-token-url>",
skipSubmitReview: false,
},
})
.then(results => console.log(results))
.catch(err => console.error(err));Contributing
Contributor Setup
- Install node
- Install
pnpmcorepack enable - Install dependencies
pnpm i - Run the
initcommand to generate a.env.submitfile for testingpnpm publish-extension initMake sure to set the Firefox channel to "unlisted", chrome's publish target to "trustedTesters", and don't submit the extension for review for Chrome or Edge. This will prevent you from accidentally releasing one of the test extensions publically.
- Run the dev commands to upload a test extension to the stores:
pnpm dev:all pnpm dev:chrome pnpm dev:firefox pnpm dev:edge
9 months ago
11 months ago
9 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago