All Projects → pastak → chrome-webstore-manager

pastak / chrome-webstore-manager

Licence: MIT License
https://www.npmjs.com/package/chrome-webstore-manager

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to chrome-webstore-manager

Pomodoro-Calculator
A pretty command line tool to calculate the number of pomodoros available between two points in time.
Stars: ✭ 20 (-37.5%)
Mutual labels:  command-line-tool
pipecolor
A terminal filter to colorize output
Stars: ✭ 17 (-46.87%)
Mutual labels:  command-line-tool
harwest-tool
A one-shot tool to harvest submissions from different OJs onto one single VCS managed repository http://bit.ly/harwest
Stars: ✭ 89 (+178.13%)
Mutual labels:  command-line-tool
go
Go-based command-line tool for the remove.bg API
Stars: ✭ 91 (+184.38%)
Mutual labels:  command-line-tool
nycurl
A web server that fetches data from the New York Times and formats it for display in the terminal.
Stars: ✭ 27 (-15.62%)
Mutual labels:  command-line-tool
rotten tomatoes cli
Rotten Tomatoes CLI
Stars: ✭ 14 (-56.25%)
Mutual labels:  command-line-tool
google-photos-plus
A chrome extension that allows you to download photos from Google Photos in better quality than the default download option.
Stars: ✭ 61 (+90.63%)
Mutual labels:  chrome-extensions
flynt-cli
CLI tool for the WordPress Flynt framework
Stars: ✭ 15 (-53.12%)
Mutual labels:  command-line-tool
cfdns
Command line tool for manipulating DNS of CloudFlare hosted domains
Stars: ✭ 20 (-37.5%)
Mutual labels:  command-line-tool
doing-cli
CLI tool to simplify the development workflow on azure devops
Stars: ✭ 19 (-40.62%)
Mutual labels:  command-line-tool
minimist2
TypeScript/JavaScript ES6 rewrite of popular Minimist argument parser
Stars: ✭ 20 (-37.5%)
Mutual labels:  command-line-tool
pganonymize
A commandline tool for anonymizing PostgreSQL databases
Stars: ✭ 20 (-37.5%)
Mutual labels:  command-line-tool
sample
Produce a sample of lines from files.
Stars: ✭ 17 (-46.87%)
Mutual labels:  command-line-tool
yj
Command line tool that converts YAML to JSON
Stars: ✭ 62 (+93.75%)
Mutual labels:  command-line-tool
gomphotherium
Gomphotherium (/ˌɡɒmfəˈθɪəriəm/; "welded beast"), a command line Mastodon client.
Stars: ✭ 22 (-31.25%)
Mutual labels:  command-line-tool
goto
Goto - The Good Way to Program
Stars: ✭ 14 (-56.25%)
Mutual labels:  command-line-tool
sane
make, but sane.
Stars: ✭ 15 (-53.12%)
Mutual labels:  command-line-tool
AppIconSetGen
Tool to generate App Icon set for iOS, macOS, watchOS apps
Stars: ✭ 20 (-37.5%)
Mutual labels:  command-line-tool
garmin-connect-export
Downloads gpx, tcx or original fit files from your Garmin Connect Account.
Stars: ✭ 42 (+31.25%)
Mutual labels:  command-line-tool
liszt
Save snippets of information quickly through the command line
Stars: ✭ 15 (-53.12%)
Mutual labels:  command-line-tool

chrome-webstore-manager

INSTALL

$ npm install -g chrome-webstore-manager

HOW TO USE

Create new item

  • $ chrome-webstore-manager insert /path/to/your_extension.zip
    • caution: it requires zip NOT crx
  • return value: chrome-web-store-item-id

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

Publish item

  • $ chrome-webstore-manager publish ITEM_ID
    • ITEM_ID: chrome-web-store-item-id

Update item

  • $ chrome-webstore-manager update ITEM_ID /path/to/your_extension.zip
    • ITEM_ID: chrome-web-store-item-id

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

  • Prepare the client ID and client secret to use Chrome Web Store API according to https://developer.chrome.com/webstore/using_webstore_api#beforeyoubegin
  • You can get access token via this commands.
    • $ chrome-webstore-manager token --client_id [YOUR_CLIENT_ID] --client_secret [YOUR_CLIENT_SECRET]
    • After a while, open your browser then accept Google OAuth.

Set your access_token

  • You can pass access_token to command.
    • You can set command's optional value -t or --token
    • You can set access_token as environment value named WEBSTORE_TOKEN
      • If you use it on *CI, it is useful export WEBSTORE_TOKEN=[YOUR_ACCESS_TOKEN]

Get access token using refresh token

  • You get new access token with $ chrome-webstore-manager refresh_token --client_id [YOUR_CLIENT_ID] --client_secret [YOUR_CLIENT_SECRET] --refresh_token [YOUR_REFRESH_TOKEN]
    • You can use environment variable WEBSTORE_REFRESH_TOKEN instead of refresh_token

Usage Example

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].