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

nexuspay

v0.1.0

Published

SDK serveur Node.js pour l'API NexusPay — sessions de paiement, produits, clients, factures, webhooks.

Readme

nexuspay

SDK serveur Node.js (≥ 18) pour l'API NexusPay — sessions de paiement, produits, clients, factures et webhooks. Zéro dépendance.

La clé secrète sk_… ne doit jamais être exposée côté navigateur. Pour le bouton de paiement front, voir le SDK navigateur (https://nexuspay.fr/sdk/nexus.js).

Installation

npm install nexuspay

(Node ≥ 18 — fetch et crypto natifs, zéro dépendance.)

Démarrage

import { Nexus } from 'nexuspay';

const nexus = new Nexus({ apiKey: process.env.NEXUS_SECRET_KEY });

// Créer et émettre une facture (idempotent)
const invoice = await nexus.invoices.create({
  customer: { name: 'Acme SAS', email: '[email protected]', externalId: 'CRM-1042' },
  lines: [{ designation: 'Développement — sprint 12', quantity: 5, unitPriceCents: 60000, vatRate: 20, unit: 'j' }],
  dueDate: '2026-07-12',
  finalize: true,
}, { idempotencyKey: 'fac-sprint-12' });

console.log(invoice.number, invoice.paymentUrl);

// L'envoyer par email (PDF Factur-X joint + bouton de paiement)
await nexus.invoices.send(invoice.id, { message: 'Merci pour votre confiance !' });

// Session de checkout (params snake_case, comme l'API)
const session = await nexus.checkoutSessions.create({
  amount: 4900,
  currency: 'EUR',
  description: 'Abonnement Pro — juin',
  success_url: 'https://votre-site.fr/merci',
}, { idempotencyKey: 'commande-1042' });
// → redirigez votre client vers session.url

Vérifier un webhook

Nexus signe le corps brut en HMAC-SHA256 (X-Nexus-Signature: t=<unix>,v1=<hex>). Passez le corps brut, jamais l'objet re-sérialisé :

import { verifyWebhookSignature } from 'nexuspay';

app.post('/nexus/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
  const ok = verifyWebhookSignature({
    payload: req.body,                          // Buffer brut
    header: req.get('X-Nexus-Signature'),
    secret: process.env.NEXUS_WEBHOOK_SECRET,   // affiché une fois à la création de l'endpoint
  });
  if (!ok) return res.status(400).end();

  const { event, data } = JSON.parse(req.body);
  if (event === 'invoice.paid' && data.livemode) {
    // … livrer / réconcilier
  }
  res.status(200).end();
});

Mode test

Créez une clé avec {"mode":"test"} (préfixe sk_test_) : clients et factures vivent dans un bac à sable étanche (numéros TEST-*, pas de comptabilité, pas de page de paiement, livemode: false partout). Détails : https://nexuspay.fr/docs#authentification

Erreurs

Toute réponse non-2xx lève une NexusError avec status, body (JSON renvoyé par l'API) et message (body.error).

Tests

npm test

Référence complète

Documentation : https://nexuspay.fr/docs · Spec OpenAPI : https://nexuspay.fr/openapi.yaml