chrome-webstore-upload uses the Chrome Web Store API.
Here's how to get its 3 access keys: clientId
, clientSecret
, refreshToken
Note: the names you enter here don't really matter. This will take approximately 10 minutes and Google likes to change these screens often. Sorry.
-
Visit https://console.developers.google.com/apis/credentials
-
Create a project:
-
Enter
chrome-webstore-upload
and Create -
Click on Configure consent screen
-
Select on External and Create
-
Only enter the Application name (e.g.
chrome-webstore-upload
) and required email fields, and click Save -
On the 3rd screen, add your own email address:
-
Visit https://console.developers.google.com/apis/library/chromewebstore.googleapis.com
-
Click Enable
-
Visit https://console.developers.google.com/apis/credentials
-
Click Create credentials > OAuth client ID:
-
Select Desktop app (or Other), enter
chrome-webstore-upload
and click Create -
Save your ✅
clientId
and ✅clientSecret
, these are 2 of the required 3 keys -
Visit https://console.cloud.google.com/apis/credentials/consent
-
Click PUBLISH APP and confirm
-
Place your
clientId
in this URL and open it: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
-
Follow its steps and warnings (this is your own personal app)
-
Wait on this page:
-
Run this in your browser console on that last page. It's a wizard to create your
refresh_token
:
(async () => {
const response = await fetch('https://accounts.google.com/o/oauth2/token', {
method: "POST",
body: new URLSearchParams([
['client_id', prompt('Enter your clientId')],
['client_secret', prompt('Enter your clientSecret')],
['code', new URLSearchParams(location.search).get('approvalCode')],
['grant_type', 'authorization_code'],
['redirect_uri', 'urn:ietf:wg:oauth:2.0:oob']
]),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
const json = await response.json();
console.log(json);
if (!json.error) {
if (typeof copy === 'function') {
copy(json.refresh_token);
alert('The refresh_token has been copied into your clipboard. You’re done!');
} else {
console.log('Copy your token:', json.refresh_token);
alert('Copy your refresh_token from the console output. You’re done!');
}
}
})();
- Done. Now you should have ✅
clientId
, ✅clientSecret
and ✅refreshToken
. You can use these for all your extensions, but don't share them!