- Go here
https://console.developers.google.com/apis/api/chromewebstore/overview
- Create a project.
- Go here again
https://console.developers.google.com/apis/api/chromewebstore/overview
- Credentials > Create Credentials > Oauth Client ID
- Configure Concent Screen
- Enter
yourextensionname
- Select Other > then click Create
- Save clientId and clientSecret
- Copy this below in a notepad and Replace the
YOUR_CLIENT_ID
with the clientId we got from above step 1. https://accounts.google.com/o/oauth2/auth?client_id=YOUR_CLIENT_ID&response_type=code&scope=https://www.googleapis.com/auth/chromewebstore&redirect_uri=urn:ietf:wg:oauth:2.0:oob
- Now open the link in a browser. You will see another code, save it too. We will call it code.
- Now paste the following in browsers console,
copy(`curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${encodeURIComponent(prompt('Enter your clientId'))}&client_secret=${encodeURIComponent(prompt('Enter your clientSecret'))}&code=${encodeURIComponent(prompt('Enter your authcode'))}&grant_type=authorization_code&redirect_uri=urn:ietf:wg:oauth:2.0:oob"`);alert('The curl has been copied. Paste it into your terminal.')
and enter the three codes.
- You'll get another code for curl.
- Paste that on terminal to get access token and refresh token.
Now we have three codes.
clientId: 'xxxxxxxxxx'
clientSecret: 'xxxxxxxxxx'
refreshToken: 'xxxxxxxxxx'
We can use them to login to store and publish stuff automatically.
- To upload an extension automatically, we need to save the extension id.
- If this is the chrome url,
https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
then we have to save thegbmdgpbipfallnflgajpaliibnhdgobh
part from it.