Package Exports
- web-ext-deploy
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (web-ext-deploy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
WebExt Deploy
The ultimate automation tool for deploying to multiple extension stores simultaneously!
Supported stores:
Core packages used
- Puppeteer - for updating extensions on Firefox Add-ons / Edge Add-ons Add-ons / Opera Add-ons store.
- Chrome Web Store Publish API
Installing
npm i -D web-ext-deploy
# or
yarn add -D web-ext-deploy
# or
pnpm i -D web-ext-deployDeployment to Chrome Web Store: follow this guide.
Usage
1. Obtain the relevant cookie(s) of the publisher's account:
- Firefox:
sessionid - Opera:
sessionid,csrftoken - Edge:
.AspNet.Cookies
If you have a hard time obtaining the cookie(s), you can run:
web-ext-deploy --get-cookies=firefox edge operaNote that for the Chrome Web Store, you'll use the Chrome Web Store Publish API.
2. Decide how to access the info
If using .env
Use the .env snippet(s) relevant to your extension.
Include each one in your root directory.
Make sure to have *.env in your .gitignore
Note that if you used the aforementioned --get-cookies, it automatically added the .env listing(s) to it.
To use the .env files, in the CLI:
web-ext-deploy --envAdditional arguments for the .env mode:
--verboseboolean?
If specified, the steps of every store will be logged to the console.--zipstring?
If specified, it will be used for every.envthat theZIPis not specified.--firefox-changelogstring?
If specified andfirefox.envexists, it will be used to provide changelog for the Firefox users.
New lines (\n) are supported.--firefox-dev-changelogstring?
If specified andfirefox.envexists, it will be used to provide changelog for the Firefox Add-ons reviewers.
New lines (\n) are supported.--edge-dev-changelogstring?
If specified andedge.envexists, it will be used to provide changelog for the Edge Add-ons reviewers.
New lines (\n) are supported.--opera-changelogstring?
If specified andopera.envexists, it will be used to provide changelog for the Opera users.
New lines (\n) are supported.
Notes:
Chrome Web Store:
REFRESH_TOKEN,CLIENT_ID,CLIENT_SECRET- follow this guide.EXT_ID- Get it fromhttps://chrome.google.com/webstore/detail/EXT_ID, e.g.https://chrome.google.com/webstore/detail/fcphghnknhkimeagdglkljinmpbagone
Firefox Add-ons store:
EXT_ID- Get it fromhttps://addons.mozilla.org/addon/EXT_IDZIP- The relative path to the ZIP. You can use{version}, which will be replaced by theversionentry from yourpackage.jsonZIP_SOURCE- Optional. The relative path to the ZIP that contains the source code of your extension, if applicable.
Edge Add-ons store:
EXT_ID- Get it fromhttps://partner.microsoft.com/en-us/dashboard/microsoftedge/EXT_IDZIP- You can use{version}
Opera Add-ons store:
PACKAGE_ID- Get it fromhttps://addons.opera.com/developer/package/PACKAGE_IDZIP- You can use{version}- Source code inspection:
The Opera Add-ons reviewers require inspecting your extension's source code.
This can be done by doing one of the following:- Uploading the ZIP that contains the source code to a public folder on a storage service (e.g. Google Drive).
- Making the extension's code open source on a platform like GitHub, with clear instructions on the
README.md, and then linking to its repository.
The keys are case-insensitive, as they will be camel-cased anyway.
Possible .env files
chrome.env
REFRESH_TOKEN="RefreshToken"
CLIENT_ID="ClientID"
CLIENT_SECRET="ClientSecret"
ZIP="dist/some-zip-v{version}.zip"
EXT_ID="ExtensionID"firefox.env
sessionid="sessionid_value"
ZIP="dist/some-zip-v{version}.zip"
ZIP_SOURCE="dist/some-zip-source-v{version}.zip"
EXT_ID="ExtensionID"edge.env
cookie=".AspNet.Cookies_value"
ZIP="dist/some-zip-v{version}.zip"
EXT_ID="ExtensionID"opera.env
sessionid="sessionid_value"
csrftoken="csrftoken_value"
ZIP="dist/some-zip-v{version}.zip"
PACKAGE_ID="PackageID"If using CLI
Use it only if your extension's code will not be published.
web-ext-deploy --chrome-zip="some-zip-v{version}.zip" --chrome-ext-id="ExtensionID" --firefox-zip="some-zip-v{version}.zip" --firefox-ext-id="ExtensionID"CLI API
--verboseboolean?
If specified, the steps of every store will be logged to the console.--zipstring?
If specified, it will be used for every store that thezipis not specified.
For example, inweb-ext-deploy --zip="zip-v{version}.zip" --chrome-refresh-token="refreshToken" --firefox-sessionid="sessionid_value" --edge-zip="some-zip-v{version}.zip"
the
zip-v{version}.zipwill be used for the Chrome Web Store version and the Firefox Add-ons version.Chrome Web Store
--chrome-ext-idstring
Get it fromhttps://chrome.google.com/webstore/detail/EXT_ID, e.g.https://chrome.google.com/webstore/detail/fcphghnknhkimeagdglkljinmpbagone--chrome-refresh-tokenstring
The refreshToken you have registered.--chrome-client-idstring
The client ID you have registered.--chrome-client-secretstring
The client secret you have registered.--chrome-zipstring
The relative path to the ZIP from the root.
You can use{version}in the ZIP filename, which will be replaced by the version inpackage.json
To get your
--chrome-refresh-token,--chrome-client-idand--chrome-client-secret, follow this guide.
Example:web-ext-deploy --chrome-ext-id="ExtensionID" --chrome-refresh-token="RefreshToken" --chrome-client-id="ClientID" --chrome-client-secret="ClientSecret" --chrome-zip="some-zip-v{version}.zip"
Firefox Add-ons
--firefox-ext-idstring
The extension ID from the store URL, e.g.https://addons.mozilla.org/addon/EXT_ID--firefox-sessionidstring
The value of thesessionidcookie, which will be used to log in to the publisher's account.
If you have a hard time getting its value, run:web-ext-deploy --get-cookies=firefox--firefox-zipstring
The relative path to the ZIP from the root.
You can use{version}in the ZIP filename, which will be replaced by theversionentry from yourpackage.json--firefox-zip-sourcestring?
The relative path to the ZIP that contains the source code of your extension, if applicable.
You can use{version}as well.--firefox-changelogstring?
The changes made in this version compared to the previous one. The Firefox users will see this.
You can use\nfor new lines.--firefox-dev-changelogstring?
The technical changes made in this version, which will be seen by the Firefox Add-ons reviewers.
You can use\nfor new lines.
Example:
web-ext-deploy --firefox-ext-id="ExtensionID" --firefox-sessionid="sessionid_value" --firefox-zip="dist/some-zip-v{version}.zip" --firefox-changelog="Changelog\nWith line breaks" --firefox-dev-changelog="Changelog for reviewers\nWith line breaks"
Edge Add-ons
--edge-ext-idstring
The extension ID from the Edge Add-ons Dashboard, e.g.https://partner.microsoft.com/en-us/dashboard/microsoftedge/EXT_ID--edge-cookiestring
The value of the cookie.AspNet.Cookies, which will be used to log in to the publisher's account.--edge-zipstring
The path to the ZIP from the root.
You can use{version}in the ZIP filename, which will be replaced by theversionentry inpackage.json--edge-dev-changelogstring?
The technical changes made in this version, which will be seen by the Edge Add-ons reviewers.
You can use\nfor new lines.
Example:
web-ext-deploy --edge-ext-id="ExtensionID" --edge-cookie=".AspNet.Cookies value" --edge-zip="dist/some-zip-v{version}.zip" --edge-dev-changelog="Changelog for reviewers\nWith line breaks"
Opera Add-ons
--opera-package-idnumber
The extension ID from the Opera Add-ons Dashboard, e.g.https://addons.opera.com/developer/package/PACKAGE_ID--opera-sessionidstring
The value of the cookiesessionid, which will be used to log in to the publisher's account.--opera-csrftokenstring
The value of the cookiecsrftoken, which will be used to upload the ZIP.--opera-zipstring
The relative path to the ZIP from the root.
You can use{version}in the ZIP filename, which will be replaced by theversionentry inpackage.json--opera-changelogstring?
The changes made in this version, which will be seen by the Opera Add-ons reviewers.
You can use\nfor new lines.
Example:
web-ext-deploy --opera-ext-id="ExtensionID" --opera-sessionid="sessionid_value" --opera-csrftoken="csrftoken_value" --opera-zip="dist/some-zip-v{version}.zip" --opera-changelog="Changelog\nWith line breaks"
Notes:
- Source code inspection:
The Opera Add-ons reviewers require inspecting your extension's source code.
This can be done by doing one of the following:- Uploading the ZIP that contains the source code to a public folder on a storage service (e.g. Google Drive)
- Making the extension's code open source on a platform like GitHub, with clear instructions on the
README.md, and then linking to its repository.
If using Node.js
ESM / TypeScript
import { deployChrome, deployFirefox, deployEdge, deployOpera } from "web-ext-deploy";CommonJS
const { deployChrome, deployFirefox, deployEdge, deployOpera } = require("web-ext-deploy");Node.js API
deployChromeobject
Options:extIdstring
Get it fromhttps://chrome.google.com/webstore/detail/EXT_ID, e.g.https://chrome.google.com/webstore/detail/fcphghnknhkimeagdglkljinmpbagonerefreshTokenstring
The refresh token.clientIdstring
The client ID.clientSecretstring
The client secret.zipstring
The relative path from the root to the ZIP.
You can use{version}to use theversionentry from yourpackage.jsonverboseboolean?
Iftrue, it will be logged to the console when the uploading has begun.
To get your
refreshToken,clientId, andclientSecret, follow this guide.
ReturnsPromise<true>or throws an exception.deployFirefoxobject
Options:extIdstring
Get it fromhttps://addons.mozilla.org/addon/EXT_IDsessionidstring
The value of the cookiesessionid, which will be used to log in to the publisher's account.
If you have a hard time obtaining it, you can run:
web-ext-deploy --get-cookies=firefoxzipstring
The relative path from the root to the ZIP.
You can use{version}in the ZIP filename, which will be replaced by theversionentry from yourpackage.jsonzipSourcestring?
The relative path from the root to the ZIP that contains the source code of your extension, if applicable.
You can use{version}as well.changelogstring?
The changes made in this version, compared to the previous one, which will be seen by the Firefox users.
I recommend providing the changelog via--firefox-changelog, so it stays dynamic.devChangelogstring?
The technical changes made in this version, compared to the previous one, which will be visible only to the Firefox Add-ons reviewers.
I recommend providing the changelog via--firefox-dev-changelog, so it stays up to date.verboseboolean?
Iftrue, every step of uploading to the Firefox Add-ons will be logged to the console.
Returns
Promise<true>or throws an exception.deployEdgeobject
Options:extIdstring
Get it fromhttps://partner.microsoft.com/en-us/dashboard/microsoftedge/EXT_IDcookiestring
The value of the cookie.AspNet.Cookies, which will be used to log in to the publisher's account.
If you have a hard time obtaining it, you can run:
web-ext-deploy --get-cookies=edgezipstring
The relative path from the root to the ZIP.
You can use{version}in the ZIP filename, which will be replaced by theversionentry from yourpackage.jsondevChangelogstring?
The changes made in this version, compared to the previous one, which will be visible only to the Edge Add-ons reviewers.
I recommend providing the changelog via--edge-dev-changelog, so it stays up to date.verboseboolean?
Iftrue, every step of uploading to the Edge Add-ons will be logged to the console.
Returns
Promise<true>or throws an exception.deployOperaobject
Options:packageIdnumber
The package ID of the extension from the store dashboard, e.g.https://addons.opera.com/developer/package/PACKAGE_IDsessionidstring
The value of the cookiesessionid, which will be used to log in to the publisher's account.csrftokenstring
The value of the cookiecsrftoken, which will be used to upload the ZIP.zipstring
The relative path from the root to the ZIP.
You can use{version}in the ZIP filename, which will be replaced by theversionentry from yourpackage.jsonchangelogstring?
The changes made in this version, compared to the previous one, which will be seen by the Opera users.
I recommend providing the changelog via--opera-changelog, so it stays up to date.verboseboolean?
Iftrue, every step of uploading to the Opera Add-ons will be logged to the console.
If you have a hard time obtaining the values of the cookies
sessionidandcsrftoken, you can run:web-ext-deploy --get-cookies=operaReturns
Promise<true>or throws an exception.Notes:
- Source code inspection:
The Opera Add-ons reviewers require inspecting your extension's source code.
This can be done by doing one of the following:- Uploading the ZIP that contains the source code to a public folder on a storage service (e.g. Google Drive)
- Making the extension's code open source on a platform like GitHub, with clear instructions on the
README.md, and then linking to its repository.
Examples:
import { deployChrome, deployFirefox, deployEdge, deployOpera } from "web-ext-deploy";
deployChrome({
extId: "EXT_ID",
refreshToken: "refreshToken",
clientId: "clientId",
clientSecret: "clientSecret",
zip: "dist/some-zip-v{version}.zip",
verbose: false
}).catch(console.error);
deployFirefox({
extId: "EXT_ID",
sessionid: "sessionid_value",
zip: "dist/some-zip-v{version}.zip",
zipSource: "dist/zip-source-v{version}.zip",
changelog: "Some changes",
devChangelog: "Changes for reviewers",
verbose: false
}).catch(console.error);
deployEdge({
extId: "EXT_ID",
cookie: ".AspNet.Cookies value",
zip: "dist/some-zip-v{version}.zip",
devChangelog: "Changes for reviewers",
verbose: false
}).catch(console.error);
deployOpera({
packageId: 123456,
sessionid: "sessionid_value",
csrftoken: "csrftoken_value",
zip: "dist/some-zip-v{version}.zip",
changelog: "Some changes",
verbose: false
}).catch(console.error);