Skip to content

A comprehensive, up-to-date TypeScript-first Paystack API client tailored for browser runtimes, generated directly from Paystack’s API specification. It’s designed to give developers a typed, spec-driven way to integrate Paystack’s payment services into frontend applications.

Notifications You must be signed in to change notification settings

alexasomba/paystack-browser

Repository files navigation

@alexasomba/paystack-browser

TypeScript-first Paystack API client for browser runtimes, generated from this repo’s OpenAPI spec.

Note: Paystack API endpoints generally require a secret key. Do not expose secret keys in a real browser app.

Why this SDK

  • Spec-driven: generated from the OpenAPI spec in this repo.
  • Typed operations: ergonomic helpers generated from operationId.
  • Production-friendly networking: built-in timeoutMs and safe retry defaults.

Modules

  • Charge
  • Customers
  • Plans
  • Products
  • Subscriptions
  • Transactions
  • Verify Payments (Transaction verification)
  • Transfers
  • Dedicated Virtual Accounts
  • Apple Pay
  • Subaccounts
  • Transaction Splits
  • Settlements
  • Transfers Control (OTP settings; under Transfers)
  • Transfer Recipients
  • Bulk Charges
  • Refunds
  • Verification (Resolve Account / Validate Account / Resolve Card BIN)
  • Miscellaneous
  • Disputes
  • Control Panel (Payment session timeout)
  • Terminal
  • Virtual Terminal
  • Direct Debit
  • Payment Pages
  • Payment Requests (Invoices)
  • Integration
  • Balance
  • Banks
  • Orders
  • Storefronts

Install

pnpm add @alexasomba/paystack-browser
# or: npm i @alexasomba/paystack-browser
# or: yarn add @alexasomba/paystack-browser

Usage

import { createPaystack } from '@alexasomba/paystack-browser';

const paystack = createPaystack({
  apiKey: 'YOUR_KEY',
  // Optional reliability knobs
  timeoutMs: 30_000,
  retry: { retries: 2 },
});

const { data, error } = await paystack.transaction_initialize({
  body: {
    email: 'customer@example.com',
    amount: 5000,
  },
});

if (error) throw error;
console.log(data);

Coverage

  • The Browser SDK currently generates ~119 typed operations from the bundled SDK OpenAPI spec.
  • For missing/incorrect endpoints, please open an issue or PR against the spec (src/assets/sdk/paystack.yaml).

About

A comprehensive, up-to-date TypeScript-first Paystack API client tailored for browser runtimes, generated directly from Paystack’s API specification. It’s designed to give developers a typed, spec-driven way to integrate Paystack’s payment services into frontend applications.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages