Giter VIP home page Giter VIP logo

chrome-webstore-upload's Introduction

Web Store Upload

CI status

A small node.js module to upload/publish extensions to the Chrome Web Store.

If you're looking to upload/publish from the CLI, then use chrome-webstore-upload-cli.

Install

npm install --save-dev chrome-webstore-upload

Setup

You will need a Google API clientId, a clientSecret and a refreshToken. Read the guide.

Usage

All methods return an ES2015-compliant promise.

Create a new client

const webStore = require('chrome-webstore-upload')({
    extensionId: 'ecnglinljpjkbgmdpeiglonddahpbkeb',
    clientId: 'xxxxxxxxxx',
    clientSecret: 'xxxxxxxxxx',
    refreshToken: 'xxxxxxxxxx' 
});

Upload to existing extension

const fs = require('fs');

const myZipFile = fs.createReadStream('./mypackage.zip');
const token = 'xxxx'; // optional. One will be fetched if not provided
webStore.uploadExisting(myZipFile, token).then(res => {
    // Response is a Resource Representation
    // https://developer.chrome.com/webstore/webstore_api/items#resource 
});

Publish extension

const target = 'default'; // optional. Can also be 'trustedTesters'
const token = 'xxxx'; // optional. One will be fetched if not provided
webStore.publish(target, token).then(res => {
   // Response is documented here:
   // https://developer.chrome.com/webstore/webstore_api/items/publish 
});

Fetch token

webStore.fetchToken().then(token => {
   // Token is a string 
});

Tips

  • If you plan to upload and publish at the same time, use the fetchToken method, and pass it to both uploadExisting and publish as the optional second parameter. This will avoid those methods making duplicate calls for new tokens.

Prior Art

chrome-webstore-upload's People

Contributors

fregante avatar bfred-it avatar dellagustin avatar fire015 avatar notlmn avatar lucasmrdt avatar travisbloom avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.