Home

Awesome

chrome-webstore-manager

INSTALL

$ npm install -g chrome-webstore-manager

HOW TO USE

Create new item

Only this command, your items is under draft. So you should publish item. I write about it on below.

Publish item

Update item

Example

Sample webapp for release chrome extenison on heroku

https://github.com/pastak/chrome-extension-release-heroku

Use on NodeJS

const ChromeWebstore = require('chrome-webstore-manager')
const fileBin = fs.readFileSync('./extension.zip')
// chrome web store item id
const itemId = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

// Initialize with ClientID and ClinetSecret
const chromeWebstore = new ChromeWebstore(client_id, client_secret)

// Get authorize URL
const getCodeUrl = chromeWebstore.getCodeUrl()

const code = open_browser_and_input_authorized_code(getCodeUrl)

// Get OAuth access token
const token = chromeWebstore.getAccessToken(code)

// Create new item
chromeWebstore.insertItem(token, fileBin).then((data) => { do_something })

// Update item
chromeWebstore.updateItem(token, fileBin, itemId).then((data) => { do_something })

// Make item publish
// target is 'trustedTesters' OR 'default'. default is 'default'
const target = 'trustedTesters'
chromeWebstore.publishItem(token, itemId, target).then((data) => { do_something })

// Get new token with refresh_token
chromeWebstore.getRefreshToken(refreshToken).then(function (data) {
  const json = JSON.parse(data)
  const newToken = json.access_token
})

More Info about token

Get access token

Set your access_token

Get access token using refresh token

Usage Example

$ WEBSTORE_TOKEN=$(chrome-webstore-manager refresh_token ...) chrome-webstore-manager update ITEM_ID extension.zip