chrome webstore upload
v3.1.4
크롬 웹 스토어에 확장을 업로드/게시 할 작은 노드 .JS 모듈.
CLI에서 업로드/게시하려는 경우 Chrome-Webstore-Upload-Cli를 사용하십시오.
npm install --save-dev chrome-webstore-upload
Google API clientId , clientSecret 및 refreshToken 필요합니다. 가이드를 사용하십시오.
모든 방법은 약속을 반환합니다.
import chromeWebstoreUpload from 'chrome-webstore-upload' ;
const store = chromeWebstoreUpload ( {
extensionId : 'ecnglinljpjkbgmdpeiglonddahpbkeb' ,
clientId : 'xxxxxxxxxx' ,
clientSecret : 'xxxxxxxxxx' ,
refreshToken : 'xxxxxxxxxx' ,
} ) ; import fs from 'fs' ;
const myZipFile = fs . createReadStream ( './mypackage.zip' ) ;
const token = 'xxxx' ; // optional. One will be fetched if not provided
const response = await store . uploadExisting ( myZipFile , token ) ;
// response is a Resource Representation
// https://developer.chrome.com/webstore/webstore_api/items#resource const target = 'default' ; // optional. Can also be 'trustedTesters'
const token = 'xxxx' ; // optional. One will be fetched if not provided
const deployPercentage = 25 ; // optional. Will default to 100%.
const response = await store . publish ( target , token , deployPercentage ) ;
// response is documented here:
// https://developer.chrome.com/webstore/webstore_api/items#publish const projection = "DRAFT" ; // optional. Can also be 'PUBLISHED' but only "DRAFT" is supported at this time.
const token = "xxxx" ; // optional. One will be fetched if not provided
const response = await store . get ( projection , token ) ;
// response is documented here:
// https://developer.chrome.com/docs/webstore/webstore_api/items#get const token = store . fetchToken ( ) ;
// token is astring fetchToken 메소드를 사용하여 uploadExisting 및 publish 로 게시하여 선택적 두 번째 매개 변수로 전달하십시오. 이를 통해 새로운 토큰을 복제하는 방법을 피할 수 있습니다.