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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@35m/sdk

v0.1.0

Published

35pay 客户端 SDK · 5 行接入聚合支付(WeChat / Alipay / Stripe / Creem / 易支付)

Downloads

81

Readme

@35m/sdk

35pay 的 JavaScript / TypeScript SDK。

安装

npm i @35m/sdk

用法

1. 创建支付

import { createPay } from '@35m/sdk'

const pay = createPay({
  apiKey: process.env.PAY_SECRET_KEY!, // sk_test_xxx 或 sk_live_xxx
})

const session = await pay.createCheckout({
  amount: 9900,                    // 单位:分
  currency: 'CNY',
  description: '追思视频套餐',
  metadata: { orderId: order.id },
  successUrl: 'https://yoursite.com/orders/123',
  cancelUrl:  'https://yoursite.com/orders/123?canceled',
})

// 把用户重定向到 35pay 托管收银台
res.redirect(session.url)

2. 接收 Webhook

35pay 在用户支付完成后会调用你配置的 Webhook URL。所有请求带 X-35pay-Signature 头。

import { Pay } from '@35m/sdk'

export async function POST(req: Request) {
  const sig = req.headers.get('x-35pay-signature')!
  const body = await req.text()

  if (!Pay.verifyWebhookSignature(body, sig, process.env.PAY_WEBHOOK_SECRET!)) {
    return new Response('invalid signature', { status: 401 })
  }

  const event = JSON.parse(body) as { type: string; data: { sessionId: string; metadata: Record<string, unknown> } }

  if (event.type === 'payment.paid') {
    await markOrderPaid(event.data.metadata.orderId as string)
  }
  return new Response('ok')
}

3. 查询会话 / 退款

const session = await pay.getSession('sess_xxx')

// 退款
await pay.refund('rec_xxx', 9900, '客户要求')

与 SaaS 的关系

@35m/sdk 是一个轻量的 HTTP 客户端,所有真实支付逻辑由 35pay SaaS 处理:

  • 商户在 pay.35team.com 后台配置自己的微信 / Stripe / Creem 商户号
  • SDK 只负责创建会话、查询状态、退款这些薄 API
  • 用户的支付页面由 35pay 托管展示(你拿到 session.url 跳过去即可)
  • 资金直接走商户的 provider 账户,35pay 不持有任何资金

License

商业 License,请联系商务咨询自托管 / 企业版。