Search code examples
google-chrome-extensionchrome-web-store

How to automate publishing Chrome extension to the Web store?


Starting from Google Chrome 21.x private update sites won't be supported anymore. This forces us to move our extension to the Google Web store. Previously, we used an automatic script that created .crx file, signed it, and uploaded to the update site.

Is there a way to do script uploading extension to the Google Web store?


Solution

  • Since March 2014, there is an API to do that. Documentation here.

    I never worked with it, so I cannot provide a full example.

    However, from the documentation, the basic flow would be an authenticated request with an updated package, followed by an authenticated request to publish:

    > curl \
    -H "Authorization: Bearer $TOKEN"  \
    -H "x-goog-api-version: 2" \
    -X PUT \
    -T $FILE_NAME \
    -v \
    https://www.googleapis.com/upload/chromewebstore/v1.1/items/$APP_ID
    
    > curl \
    -H "Authorization: Bearer $TOKEN"  \
    -H "x-goog-api-version: 2" \
    -H "Content-Length: 0" \
    -X POST \
    -v \
    https://www.googleapis.com/chromewebstore/v1.1/items/$APP_ID/publish