Utils for managing web extensions written in Go.
go install github.com/adguardteam/go-webext
Before start, you have to get credentials to the stores API.
How to get Chrome Store credentials API described here https://developer.chrome.com/docs/webstore/using_webstore_api/
After getting CODE
, CLIENT_ID
and CLIENT_SECRET
, you'd be able to get refresh_token
via request to this url
curl "https://accounts.google.com/o/oauth2/token" -d \
"client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&code=${CODE}&grant_type=authorization_code&redirect_uri=urn:ietf:wg:oauth:2.0:oob"
Note: you have to use refresh_token
instead of access_token
.
Getting credentials for Addons Mozilla Org is not difficult. You should have a Firefox account and be logged in. After that go to the following link: https://addons.mozilla.org/en-US/developers/addon/api/key/
Description about getting credentials for Microsoft Edge Addons Store can be found here: https://docs.microsoft.com/en-us/microsoft-edge/extensions-chromium/publish/api/using-addons-api#before-you-begin
Received credentials can be stored in the .env
file or provided via environment variables.
CHROME_CLIENT_ID=<client_id>
CHROME_CLIENT_SECRET=<client_secret>
CHROME_REFRESH_TOKEN=<refresh_token>
FIREFOX_CLIENT_ID=<client_id>
FIREFOX_CLIENT_SECRET=<client_secret>
EDGE_CLIENT_ID=<client_id>
EDGE_CLIENT_SECRET=<client_secret>
EDGE_ACCESS_TOKEN_URL=<access_token_url>
After that, you can use the CLI.
webext [global options] command [command options] [arguments...]
- status returns extension info
- insert uploads extension to the store
- update uploads new version of extension to the store
- publish publishes extension to the store
- sign signs extension in the store
- help, h shows a list of commands or help for one command
Examples to get extension status info from the stores:
./go-webext status chrome --app bjefoaoblohljkadffjcpkgfamdadogp
./go-webext status firefox --app [email protected]
Examples of commands to upload new extension (not uploaded before) to the stores:
./go-webext insert firefox -f ./firefox.zip -s ./source.zip
./go-webext insert chrome -f ./chrome.zip
There is no API for creating a new product. You must complete these tasks manually in Microsoft Partner Center.
Examples of commands to upload new version of extension to the stores:
./go-webext update firefox -f ./firefox.zip -s ./source.zip
./go-webext update chrome -f ./chrome.zip -a bjefoaoblohljkaaaajcpkgfamdadogp
./go-webext update edge -f ./edge.zip -a 7a933b66-f8ff-4292-bc88-db593afg4bf8
- create CLI to deploy to the stores
- chrome
- firefox
- edge
- opera
- static
- TODO add description for every possible command
- get publish status for extensions from storage (published, draft, on review)
- subscribe on status change via email or slack
- collect stats from storage
- setup sentry to collect errors