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

@better-sslcommerz/sdk

v0.3.0

Published

`@better-sslcommerz/sdk` is a production-ready TypeScript SDK for the SSLCommerz v4 gateway. It gives you typed methods, schema-backed validation, and consistent error handling for payments, order validation, refunds, transaction queries, and invoices.

Readme

@better-sslcommerz/sdk

@better-sslcommerz/sdk is a production-ready TypeScript SDK for the SSLCommerz v4 gateway. It gives you typed methods, schema-backed validation, and consistent error handling for payments, order validation, refunds, transaction queries, and invoices.

Why use this package

  • Full SSLCommerz API coverage for core and invoice flows
  • Strong TypeScript types for request and response payloads
  • Built-in request validation with optional response validation
  • IPN payload parsing support via parseIpnPayload()
  • Structured errors with SslcommerzError, SslcommerzHttpError, and SslcommerzValidationError

Install

npm install @better-sslcommerz/sdk
# or
pnpm add @better-sslcommerz/sdk
# or
yarn add @better-sslcommerz/sdk

Basic setup

1) Add environment variables

SSLCOMMERZ_STORE_ID=your_store_id
SSLCOMMERZ_STORE_PASSWD=your_store_password

Keep SSLCOMMERZ_STORE_PASSWD server-side only.

2) Create a reusable client

import { createSslcommerzClient } from "@better-sslcommerz/sdk";

export const sslcommerz = createSslcommerzClient({
  storeId: process.env.SSLCOMMERZ_STORE_ID!,
  storePasswd: process.env.SSLCOMMERZ_STORE_PASSWD!,
  environment: "sandbox", // switch to "live" in production
  // validateResponse: true, // optional, useful in development
});

3) Create a payment session

const session = await sslcommerz.core.createSession({
  total_amount: 500,
  currency: "BDT",
  tran_id: `TXN_${Date.now()}`,
  success_url: "https://yoursite.com/payment/success",
  fail_url: "https://yoursite.com/payment/fail",
  cancel_url: "https://yoursite.com/payment/cancel",
  ipn_url: "https://yoursite.com/api/ipn",
  product_name: "Premium Subscription",
  product_category: "subscription",
  product_profile: "non-physical-goods",
  cus_name: "Jane Doe",
  cus_email: "[email protected]",
  cus_add1: "123 Main Street",
  cus_city: "Dhaka",
  cus_postcode: "1207",
  cus_country: "Bangladesh",
  cus_phone: "01700000000",
  shipping_method: "NO",
  num_of_item: 1,
});

if (session.status === "SUCCESS" && session.GatewayPageURL) {
  // Redirect your customer to this URL
  console.log(session.GatewayPageURL);
}

4) Validate payment before fulfilling orders

const validation = await sslcommerz.core.validateOrder({ val_id: "..." });

if (validation.status === "VALID" || validation.status === "VALIDATED") {
  // Cross-check tran_id, amount, and currency against your own database
  // then mark order as paid
}

Always validate using validateOrder from IPN and/or success callback data before updating your database.

Notes

  • sandbox base URL: https://sandbox.sslcommerz.com
  • live base URL: https://securepay.sslcommerz.com
  • TLS 1.2+ is required by SSLCommerz