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

inpay-js

v1.0.0

Published

Official inPAY Node.js SDK — create invoices, check status, and verify webhooks for the inPAY payment platform (Uzbekistan).

Readme

inPAY Node.js SDK

Official Node.js / TypeScript SDK for the inPAY payment platform (Uzbekistan). One inPAY contract → accept Click, Payme, UzCard/HUMO with a few lines of code.

Bitta inPAY shartnomasi bilan barcha to'lov usullarini qabul qiling.

O'rnatish / Installation

npm install inpay-js

Talab: Node.js ≥ 18 (global fetch + crypto). Tashqi bog'liqliksiz. TypeScript tayyor (.d.ts ichida).

Tez boshlash / Quick start

import { InPay } from 'inpay-js';

const inpay = new InPay({
  merchantId: 12345,          // kassa merchant_id
  bearerToken: 'xxxxxxxx',    // kassa bearer token
  webhookSecret: 'yyyyyyyy',  // webhook imzosi uchun
});

// 1) To'lov yaratish
const invoice = await inpay.create({
  amount: 50000,                       // so'm (min 1000)
  callbackUrl: 'https://shop.uz/inpay/webhook',
  orderId: 'A-123',                    // sizning ichki reference
});

res.redirect(invoice.payUrl);          // foydalanuvchini yo'naltiring

invoice:

| Xususiyat | Izoh | |---|---| | invoice.orderId | inPAY buyurtma ID (16 hex) | | invoice.payUrl | Universal checkout sahifasi | | invoice.payUrlLink | So'ralgan usulga mos to'g'ridan havola | | invoice.payLinks | { click, payme } to'g'ridan havolalar |

CommonJS

const { InPay } = require('inpay-js');

2) Holatni tekshirish / Status

const tx = await inpay.status('a1b2c3d4e5f6a7b8');
if (tx.isPaid) {
  // ...
}
// tx.status: 'pending' | 'success' | 'failed'

3) Webhook (payment.success)

inPAY to'lov muvaffaqiyatli bo'lganda callbackUrl'ingizga POST yuboradi va uni X-InPAY-Signature (HMAC-SHA256) bilan imzolaydi. SDK imzoni constant-time tekshiradi.

Express misoli (xom tanani oling — express.raw):

import express from 'express';
import { InPay, SignatureError } from 'inpay-js';

const app = express();
const inpay = new InPay({ merchantId: 12345, bearerToken: 'xxx', webhookSecret: 'yyy' });

app.post('/inpay/webhook', express.raw({ type: '*/*' }), (req, res) => {
  const sig = req.header('X-InPAY-Signature') ?? '';
  try {
    const tx = inpay.webhook().verify(req.body.toString('utf8'), sig);
    if (tx.isPaid) {
      // ⚠️ IDEMPOTENT bo'ling — takror kelishi mumkin
      // if (alreadyPaid(tx.orderId)) return res.json({ ok: true });
      // markPaid(tx.orderId, tx.amount);
    }
    res.json({ ok: true });
  } catch (e) {
    if (e instanceof SignatureError) return res.status(401).json({ ok: false });
    res.status(400).json({ ok: false });
  }
});

Xavfsizlik: imzo tekshiruvidan o'tmagan webhook'ni HECH QACHON to'lov deb qabul qilmang.

Xatolar / Errors

import { ApiError, SignatureError, InPayError } from 'inpay-js';

try {
  await inpay.create({ amount: 50000 });
} catch (e) {
  if (e instanceof ApiError) console.log(e.errorCode); // "MERCHANT_INACTIVE", ...
}

Litsenziya

MIT © inPAY