suning_sdk

0.0.1 • Public • Published

suning_sdk

苏宁开放平台——苏宁推客 苏宁开放平台第三方node sdk,欢迎issue和pr。

安装

使用npm:

npm i suning_sdk -S

或者yarn:

yarn add suning_sdk

引入文件

const SunClient = require('suning_sdk').SunClient

配置

使用苏宁联盟的appKey,appSecret和api的url进行初始化:

const client = new SunClient({
    'appKey':'',
    'appSecret':'',
    'url':'https://openpre.cnsuning.com/api/http/sopRequest/'//(可不填写) 默认为https://open.suning.com/api/http/sopRequest/
});

Demo

例如关键词查询商品

const respone = await client.execute('suning.netalliance.searchcommodity.query', {
    keyword: '洋河'
})

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

Readme

Keywords

Package Sidebar

Install

npm i suning_sdk

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

7.08 kB

Total Files

6

Last publish

Collaborators

  • yanchengfangyou