Louis Innovations has released the SADAD Payment Gateway SDK for JavaScript and TypeScript, bringing first-class SADAD payment integration to the JavaScript ecosystem. This open source SDK supports web checkout, invoice management, and refund operations for Qatar and GCC e-commerce applications.

Why JavaScript Developers Need This SDK

JavaScript powers the majority of web applications in Qatar and across the GCC. From Node.js backends to React frontends, developers need reliable payment integration tools with full TypeScript support. Our SDK provides type-safe, well-documented methods for every SADAD operation, reducing integration time from weeks to hours.

Core Capabilities

Web Checkout -- Initialize payment sessions, generate checkout URLs, and handle payment callbacks. Full TypeScript type definitions ensure you catch errors at compile time, not in production. Supports both redirect-based and iframe-based checkout flows.

Invoice Management -- Create, retrieve, update, and cancel invoices programmatically. Support for recurring invoices and bulk operations. Each method returns strongly typed responses that integrate directly with your existing order management system.

Refund Operations -- Process full and partial refunds with validation. Track refund status changes and handle edge cases like expired payment windows. Built-in retry logic for network failures ensures reliable operation.

TypeScript First -- Every method, parameter, and response is fully typed. IntelliSense works out of the box in VS Code. Exported interfaces and type aliases make building custom integrations straightforward.

Dual Environment Support -- Works in Node.js for server-side integrations and in browsers for client-side checkout flows. Tree-shakeable ESM builds keep bundle sizes small when you only need specific features.

Getting Started

Install the package from npm, import the SadadClient, pass your API credentials, and start processing payments:

import { SadadClient } from '@louisinnovations/sadad-js-sdk';

const sadad = new SadadClient({
  merchantId: process.env.SADAD_MERCHANT_ID,
  apiKey: process.env.SADAD_API_KEY,
  environment: 'sandbox',
});

const transaction = await sadad.checkout.create({
  amount: 500.00,
  currency: 'QAR',
  description: 'Order #12345',
});

The README includes complete examples for Express.js webhooks, Next.js API routes, and browser-side checkout flows. For React-specific UI components, check our dedicated React component library.

Repository

The SDK is open source and available on GitHub: louisinnovationsqatar/sadad-js-sdk

Licensed under MIT. Contributions from the Qatar developer community are welcome.

Frequently Asked Questions

QDoes this SDK work in the browser? A: Yes. The SDK supports both Node.js and browser environments. Browser usage is ideal for client-side checkout flows where you need to generate payment pages directly from the frontend. Use the Node.js build for server-side webhook handling and admin operations.

QIs there a React-specific package? A: React developers can combine this SDK with our React component library for drop-in UI components, or use the raw SDK directly with custom React hooks for full control over the payment experience.

QHow do I handle payment webhooks? A: The SDK includes a built-in signature verification utility. Set up a webhook endpoint in your Express.js or Next.js application, pass the incoming SADAD payload to sadad.webhooks.verify(), and handle the verified event. Our enterprise software services can help architect a robust webhook infrastructure.

QWhat is the difference between this SDK and the PHP SDK? A: Both SDKs implement the same SADAD API specification but target different ecosystems. Choose the JS/TS SDK for Node.js backends, React/Next.js frontends, or any JavaScript-based stack. For Laravel or WordPress projects, use our PHP SDK.