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

ksher-typescript

v0.1.4

Published

Ksher TypeScript Library for http://api.ksher.net

Readme

Ksher SDK TypeScript

NPM Version

This is a third-party SDK for Node.js that focuses on providing strong TypeScript types and a developer-friendly debugging interface on top of the Ksher API. API Document Please check document at http://api.ksher.net

You can check npm SDK TypeScript or visit Github ksher_demo_nodejs repo for check example create on NodeJs.

How to install SDK

Install nodejs on you computer.

Check your nodejs working with your computer by using

node -v

Install ksher SDK by

npm install ksher-typescript

using SDK

Initial data to call

const appId = "mch35000"; // setup your appid here
const privateKey = "/Users/example/ksher_sdk_nodejs/Mch35000_PrivateKey.pem"; // or PEM text

const { createKsherClient } = require("ksher-typescript");
const client = createKsherClient({ appId, privateKey });

The client validates requests and responses with Zod and throws KsherSignatureError if the response signature is invalid. alternative way you can read your private key from string

const appId = "mch35000"; // setup your appid here
const privateKey = `-----BEGIN RSA PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END RSA PRIVATE KEY-----
`;
// setup your private key data inside pem file at here

const { createKsherClient } = require("ksher-typescript");
const client = createKsherClient({ appId, privateKey });

Website

Please see http://api.ksher.net/KsherAPI/dev/apis/website.html for more information.

create website request

const mch_order_no = Date.now().toString();
const gatewayPayResponse = await client.gatewayPay({   
  "mch_order_no": mch_order_no,
  "total_fee": "100",
  "fee_type": "THB",
  "mch_code": mch_order_no,
  "refer_url": "https://www.google.com",
  "mch_redirect_url":"https://www.google.com/api/gateway_pay/success",
  "mch_redirect_url_fail":"https://www.google.comapi/gateway_pay/fail",
  "mch_notify_url":"https://www.google.com/api/gateway_pay/notify_url/",
  "product_name": mch_order_no,
  "channel_list":"promptpay,linepay,airpay,truemoney,atome,card,ktc_instal,kbank_instal,kcc_instal,kfc_instal,scb_easy,bbl_deeplink,baybank_deeplink,kplus,alipay,wechat,card,ktc_instal,kbank_instal,kcc_instal,kfc_instal",
  "lang":"en"
});
console.log("body: ", gatewayPayResponse);

query status

const mch_order_no = "your create mch_order_no";
const gatewayOrderQueryResponse = await client.gatewayOrderQuery({   
  "mch_order_no": mch_order_no
});
console.log("body: ", gatewayOrderQueryResponse);

C scan B

Create Dynamic QR

Please see http://api.ksher.net/KsherAPI/dev/apis/kiosk_c_scan_b.html for more information.

const mch_order_no = Date.now().toString();
const nativePayResponse = await client.nativePay({
      mch_order_no: mch_order_no,
      total_fee: "100",
      fee_type:"THB",
      channel: "promptpay"
});
console.log("body: ", nativePayResponse);

query status

const mch_order_no = "your create mch_order_no";
const nativePayQueryResponse = await client.orderQuery({
    mch_order_no: "2023-02-19-17-34-00",
});
console.log("body: ", nativePayQueryResponse);

B scan C

Create Payment order

Please see https://api.ksher.net/KsherAPI/dev/apis/pos_b_scan_c.html for more information.

const mch_order_no = Date.now().toString();
const quickPayResponse = await client.quickPay({
          mch_order_no: mch_order_no,
          total_fee: "100",
          fee_type:"THB",
          channel: "truemoney",
          auth_code: "111111111111111111"
});
console.log("body: ", quickPayResponse);

query status

const mch_order_no = "your create mch_order_no";
const quickPayQueryResponse = await client.orderQuery({
    mch_order_no: "2023-02-19-17-34-00",
});
console.log("body: ", quickPayQueryResponse);

Application

Create Payment order

Please see https://api.ksher.net/KsherAPI/dev/apis/mobile_app.html for more information.

const mch_order_no = Date.now().toString();
const appPayResponse = await client.appPay({
              mch_order_no: mch_order_no,
              total_fee: "100",
              fee_type:"THB",
              channel: "wechat",
              product_name: "some product",
              refer_url: "http://www.google.com",
              notify_url: "https://your_notify_url.com/notify",
              mch_order_no: "3500114305",
              local_total_fee: 10000,
              channel_sub_appid: "wxxxxxxxxxxxx",
});
console.log("body: ", appPayResponse);

query status

const mch_order_no = "your create mch_order_no";
const appPayQueryResponse = await client.orderQuery({
    mch_order_no: "2023-02-19-17-34-00",
});
console.log("body: ", appPayQueryResponse);

Mini Program

Create Payment order

Please see https://api.ksher.net/KsherAPI/dev/apis/wechat_mini_pro.html for more information.

const mch_order_no = Date.now().toString();
const miniProgramPayResponse = await client.miniProgramPay({
              mch_order_no: mch_order_no,
              total_fee: "100",
              fee_type:"THB",
              channel: "wechat",
              product_name: "some product",
              refer_url: "http://www.google.com",
              notify_url: "https://your_notify_url.com/notify",
              mch_order_no: "3500114305",
              local_total_fee: 10000,
              channel_sub_appid: "wx8888888888888888",
              sub_openid: "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o",
});
console.log("body: ", miniProgramPayResponse);

query status

const mch_order_no = "your create mch_order_no";
const miniProgramPayQueryResponse = await client.orderQuery({
    mch_order_no: "2023-02-19-17-34-00",
});
console.log("body: ", miniProgramPayQueryResponse);