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

anore-pay

v1.0.0

Published

Official anore payments SDK for Node.js — accept SBP, cards and crypto payments

Downloads

20

Readme

anore — Node.js SDK

Официальный SDK для приёма платежей через anore. Без зависимостей, Node.js 18+.

Структура

nodejs/
├── index.js          точка входа (экспорт)
├── index.d.ts        TypeScript-типы
└── src/
    ├── client.js     AnoreClient — создание платежа, статус
    ├── transport.js  HTTP с ретраями/бэкоффом
    ├── webhooks.js   verifyWebhook / parseWebhook
    ├── models.js     Payment, WebhookEvent
    └── errors.js     иерархия ошибок

Установка

Скопируйте папку nodejs/ в проект и подключите, либо npm install ./nodejs.

const { AnoreClient, parseWebhook } = require('anore-pay')

Быстрый старт

const anore = new AnoreClient({ apiKey: 'an_live_xxxxxxxxxxxxxxxx' })

// 1. создать счёт
const payment = await anore.createPayment({
  amount: 1500,
  description: 'Подписка Pro',
  orderId: 'order_42',
  shopId: 1, // обязателен для аккаунтовых ключей (an_live_ / an_test_)
})
console.log(payment.paymentUrl) // отправьте клиента сюда

// 2. проверить статус
const status = await anore.getPayment(payment.id)
console.log(status.status, status.paid) // 'paid', true

Проверка вебхука

При оплате anore шлёт POST на ваш URL с заголовком Anore-Signature. Проверяйте подпись по сырому телу запроса (не распарсенному JSON):

const express = require('express')
const { parseWebhook, SignatureError } = require('anore-pay')

const app = express()
app.post('/webhook', express.raw({ type: '*/*' }), (req, res) => {
  try {
    const event = parseWebhook(req.body, req.headers['anore-signature'], process.env.ANORE_WEBHOOK_SECRET)
    if (event.isSucceeded) {
      // отгрузить заказ event.id / event.orderId
    }
    res.json({ ok: true })
  } catch (e) {
    if (e instanceof SignatureError) return res.status(403).end()
    throw e
  }
})

Обработка ошибок

const { AnoreClient, ValidationError, AuthenticationError, APIConnectionError } = require('anore-pay')
try {
  await anore.createPayment({ amount: 1500, description: 'Заказ' })
} catch (e) {
  if (e instanceof ValidationError) { /* 400 — кривой запрос */ }
  else if (e instanceof AuthenticationError) { /* 401 — неверный ключ */ }
  else if (e instanceof APIConnectionError) { /* сеть недоступна */ }
}

Справка

| API | Описание | |-----|----------| | new AnoreClient({ apiKey, secret?, baseUrl?, timeout?, maxRetries? }) | клиент; secret подписывает исходящие запросы | | createPayment({ amount, description, orderId?, shopId? }) | создать счёт → Payment | | getPayment(id) | статус → Payment (.status, .paid) | | verifyWebhook(rawBody, signature, secret) | проверка подписи → boolean | | parseWebhook(rawBody, signature, secret) | проверка + разбор → WebhookEvent (бросает SignatureError) |

Ошибки: ValidationError (400), AuthenticationError (401), ForbiddenError (403), NotFoundError (404), ServerError (5xx), APIConnectionError (сеть), SignatureError (подпись).

Полная документация: https://anore.cc/docs