Socket
Socket
Sign inDemoInstall

1688-open-sdk

Package Overview
Dependencies
8
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    1688-open-sdk

1688开放平台node SDK


Version published
Weekly downloads
13
decreased by-40.91%
Maintainers
1
Install size
2.04 MB
Created
Weekly downloads
 

Readme

Source

1688-open-sdk

1688开放平台node sdk,因官方没有提供node版本sdk,因此提供非官方版,希望对大家有用,欢迎issue和pr。

1688开放平台

安装

使用npm:

npm i 1688-open-sdk -S

或者yarn:

yarn add 1688-open-sdk
引入文件
import ApiExecutor from "1688-open-sdk"

或者

const ApiExecutor = require("1688-open-sdk")
配置

使用1688开放平台的appkey,appsecret进行初始化:

const apiExecutor = new ApiExecutor(process.env.APPKEY, process.env.APPSECRET)
API

// 使用refreshToken更新AccessToken

const {access_token} = await apiExecutor.refreshToken2AccessToken(refresh_token)

例如 跨境产品以图搜图:

apiExecutor.execute(
    'com.alibaba.linkplus/alibaba.cross.similar.offer.search',
    {
        picUrl:'https://img.alicdn.com/imgextra/i1/O1CN01PwAoB21LuSuZE9Oqx_!!6000000001359-2-tps-1170-597.png',
        page: 1
    },
    access_token
)

注意调用api返回的都是promise,因此可使用async/await。

Keywords

FAQs

Last updated on 10 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc