npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@blueislandx/island-union-sdk

v1.1.2

Published

Island (小蓝岛) 购物平台联盟聚合 SDK (淘宝联盟、京东联盟、多多进宝、苏宁联盟、唯品会联盟、考拉联盟、有赞联盟)

Downloads

55

Readme

npm version install size npm bundle size npm downloads Known Vulnerabilities

本 SDK 支持以下购物平台联盟:

P.S: 若没有特别标注, 所有签名算法均使用 MD5 实现

1.如何安装

npm i @blueislandx/island-union-sdk --save

2.如何使用

import union from '@blueislandx/island-union-sdk';

const client = new union.taobao.Client({
    appKey: '<你的 AppKey>',
    secretKey: '<你的 SecretKey>'
});

const result = await client.execute('<API 方法名称>', { <业务参数> });

P.S: 淘宝联盟接口必须传入字符 id, 数字 id 已经下线无法使用

import union from '@blueislandx/island-union-sdk';

const client = new union.jd.Client({
    appKey: '<你的 AppKey>',
    secretKey: '<你的 SecretKey>'
});

const result = await client.execute('<API 方法名称>', { <业务参数> });
import union from '@blueislandx/island-union-sdk';

const client = new union.pinduoduo.Client({
    appKey: '<你的 ClientId>',
    secretKey: '<你的 ClientSecret>'
});

const result = await client.execute('<API 方法名称>', { <业务参数> });

P.S: 多多进宝接口必须传入 goods_sign (字符 id), goods_id (数字 id) 已经下线无法使用

import union from '@blueislandx/island-union-sdk';

const client = new union.suning.Client({
    appKey: '<你的 AppKey>',
    secretKey: '<你的 AppSecret>'
});

const result = await client.execute('<API 方法名称>', { <业务参数> });
import union from '@blueislandx/island-union-sdk';

const client = new union.vip.Client({
    appKey: '<你的 AppKey>',
    secretKey: '<你的 AppSecret>'
});

const result = await client.execute('<API 服务名称>', '<API 服务版本>', '<API 方法名称>', { <业务参数> });
import union from '@blueislandx/island-union-sdk';

const client = new union.kaola.Client({
    secretKey: '<你的 AppSecret>',
    unionId: '<你的赚客 Id>'
});

const result = await client.execute('<API 接口名称>', { <业务参数> });
import union from '@blueislandx/island-union-sdk';

const client = new union.youzan.Client({
    appKey: '<你的 AppKey>',
    secretKey: '<你的 AppSecret>',
    grantId: '<你的有赞客 Id>'
});

const result = await client.execute('<API 接口名称>', '<API 接口版本>', { <业务参数> });

3.错误处理

如果 SDK 请求错误会返回如下格式:

{
    "code": <错误代码>,
    "message": "<错误信息>",
    "error": true
}

P.S: 判断一个请求是否失败, 请使用 error 字段而不是使用 code 字段

P.S: 错误代码 不一定 是整数类型, 请不要 parseInt, SDK 内部已经对字符串的数字进行了处理

4.重大变更

1.1.0 起, 导入名称由 island 改为 union

P.S: 该改动是由于公司内部业务模块化, 全部使用 island 会导致混乱