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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@liuliang520500/pdd-sdk-new

v1.0.2

Published

拼多多开放平台 SDK,支持多多进宝商品推广、订单查询等接口

Downloads

147

Readme

拼多多开放平台 SDK

一个简单易用的拼多多开放平台 SDK,支持所有多多客 API。

特点

  • 支持 TypeScript
  • 使用 axios 作为 HTTP 客户端
  • 支持所有多多客 API
  • 自动处理签名
  • 支持调试模式

安装

npm install @liuliang520500/pdd-sdk-new

使用示例

import { PddClient } from '@liuliang520500/pdd-sdk-new';

// 初始化客户端
const client = new PddClient({
  appKey: 'your-app-key',
  appSecret: 'your-app-secret',
  debug: true // 开启调试模式
});

// 调用商品详情 API
async function getGoodsDetail() {
  try {
    const params = {
      type: 'pdd.ddk.oauth.goods.detail',
      goods_sign: 'your-goods-sign',
      pid: 'your-pid'
    };

    const response = await client.execute(params);
    console.log(response);
  } catch (error) {
    console.error(error);
  }
}

API 文档

PddClient

构造函数

constructor(config: PddClientConfig)

配置参数:

  • appKey: 应用的 AppKey
  • appSecret: 应用的 AppSecret
  • serverUrl: 接口地址(可选,默认为 https://gw-api.pinduoduo.com/api/router)
  • debug: 是否开启调试模式(可选,默认为 false)

execute 方法

async execute<T = any>(params: Record<string, any>): Promise<T>

参数:

  • params: API 请求参数,必须包含 type 字段指定接口名称

返回值:

  • 返回 Promise,解析为接口响应数据

常见问题

1. 签名错误

确保 AppKey 和 AppSecret 正确,参数值不要包含特殊字符。

2. 请求超时

默认超时时间为 30 秒,如需修改,可以在初始化时配置:

const client = new PddClient({
  appKey: 'your-app-key',
  appSecret: 'your-app-secret',
  timeout: 60000 // 设置为 60 秒
});

许可证

MIT