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

@bakissation/fastify-satim

v2.0.0

Published

Fastify plugin for the SATIM (SATIM-IPAY) payment gateway — multi-tenant, built-in routes, schema validation, and typed decorators for CIB & Edahabia payments in Algeria. Works with Fastify v4 and v5.

Readme

@bakissation/fastify-satim

A Fastify plugin for the SATIM (SATIM-IPAY) payment gateway — drop SATIM CIB & Edahabia payments into any Fastify app with a typed fastify.satim decorator, optional built-in routes, schema validation, and multi-tenant support. Works with Fastify v4 and v5.

npm CI license

  • 🧩 Typed decoratorfastify.satim exposes the full SATIM client (register, getOrderStatus, confirm, refund) across all scopes.
  • 🏢 Multi-tenant — resolve credentials per request via getClient(request), or stay single-tenant with env vars / a config object / a pre-built client.
  • 🛣️ Built-in routes (opt-in)/register, /status, /confirm, /refund with JSON-schema validation and per-route hooks — or wire your own.
  • 🔒 Secure by default — centralized error mapping that never leaks credentials, POST-only by default, no secret logging.

📖 Read the case study → — how this plugin cuts SATIM integration from hundreds of lines of boilerplate per project to a single register() call.

Install

npm install @bakissation/fastify-satim

Requires Node.js ≥ 18 and Fastify v4 or v5. The core SDK @bakissation/satim is included.

Quick start

import Fastify from 'fastify';
import fastifySatim, { interpretOrderStatus } from '@bakissation/fastify-satim';

const fastify = Fastify();
await fastify.register(fastifySatim, { fromEnv: true });

fastify.post('/checkout', async (request, reply) => {
  const order = await fastify.satim.register({
    orderNumber: 'ORD001',
    amount: 5000,                 // 5000 DZD
    returnUrl: 'https://yoursite.com/payment/success',
    udf1: 'INV001',
  });
  if (order.isSuccessful()) return { redirectUrl: order.formUrl };
  return reply.status(400).send({ error: 'Failed to create order' });
});

fastify.post('/payment/callback', async (request) => {
  const { orderId } = request.body as { orderId: string };
  const status = await fastify.satim.getOrderStatus(orderId);
  return status.isPaid() ? { status: 'paid' } : { status: interpretOrderStatus(status.orderStatus) };
});

await fastify.listen({ port: 3000 });

There are four ways to configure the client (multi-tenant, env, object, pre-built) → docs/configuration.

Documentation

Full docs live in docs/:

| | | |---|---| | Overview & concepts | What the plugin is, when to use it vs the raw SDK, design notes | | Getting started | Install, register, first payment, environments | | Configuration | The four config modes (multi-tenant, env, object, client) | | Built-in routes | /register · /status · /confirm · /refund — paths, hooks, bodies | | Security | Auth, CSRF, error mapping, best practices | | Architecture | Module map, plugin lifecycle, routes, error handling |

For the SATIM gateway API, environments, and certification, see the core SDK docs.

Contributing

Issues and PRs welcome — read CONTRIBUTING.md and the Code of Conduct. Releases are automated from Conventional Commits via semantic-release; don't bump the version or edit the changelog by hand.

Credits

Built and maintained by Abdelbaki Berkatiberkati.xyz · @bakissation. 📖 Read the case study →

License

MIT