S
Sanwo
Get Started
Now in public beta

One SDK for every payment provider

Integrate Paystack, Flutterwave, Razorpay, PayPal, Monnify, and Interswitch with a single, type-safe API. Switch providers with one line of code.

terminal

$ npm install @sanwohq/web @sanwohq/paystack

import { createSanwo } from '@sanwohq/web'

import { paystackProvider } from '@sanwohq/paystack'

const sanwo = createSanwo({ provider: paystackProvider, publicKey: 'pk_...' })

Built for developers

Everything you need to accept payments, nothing you don't.

One Unified API

Write your payment integration once. The same CheckoutOptions work across every provider — amounts, currencies, customer data, and callbacks.

Swap Providers Instantly

Change your payment provider by swapping a single import. No rewrite needed — your checkout logic, callbacks, and types all stay the same.

Type-Safe TypeScript

Full TypeScript support with typed checkout options, provider configs, result types, and event callbacks. Catch errors before they hit production.

No Lock-In

Payments flow directly to each provider. Sanwo never touches your money, stores card data, or sits between you and the payment processor.

Framework Ready

First-class React hooks, vanilla JS support, and works with Next.js, Vue, and any web framework. Server and client-side compatible.

Provider-Specific Options

Need Paystack channels or Monnify payment methods? The sanwoProviderOptions escape hatch lets you access any provider-specific feature.

6 providers, one interface

From Lagos to Mumbai to San Francisco. More providers coming soon.

P

Paystack

Africa
@sanwohq/paystack

Currencies: NGN, GHS, ZAR, USD

F

Flutterwave

Africa
@sanwohq/flutterwave

Currencies: NGN, GHS, KES, USD, +30

P

PayPal

Global
@sanwohq/paypal

Currencies: USD, EUR, GBP, +20

R

Razorpay

India
@sanwohq/razorpay

Currencies: INR, USD

M

Monnify

Nigeria
@sanwohq/monnify

Currencies: NGN

I

Interswitch

Nigeria
@sanwohq/interswitch

Currencies: NGN, USD

Simple by default, powerful when you need it

A minimal checkout is 5 lines. Provider-specific features like payment channels, contract codes, or custom UI are just one optional field away.

Amounts in minor units

Always pass amounts in minor units (e.g. kobo, cents). Sanwo handles conversion for providers that expect major units.

Typed results

Every checkout returns a discriminated union: successful, cancelled, failed, or pending. No guessing.

Auto-generated references

Transaction references are generated automatically if you don't provide one.

checkout.ts
import { createSanwo } from '@sanwohq/web'import { paystackProvider } from '@sanwohq/paystack'
const sanwo = createSanwo({ provider: paystackProvider, publicKey: 'pk_test_...' })
// listen for lifecycle eventssanwo.on('success', (event) => { console.log('Paid!', event.data)})sanwo.on('failed', (event) => { console.log('Failed', event.data)})
const result = await sanwo({ amount: 500000, // 5,000.00 in minor units currency: 'NGN', customer: { email: 'user@example.com' }, onLoad: () => console.log('Checkout loaded'), onError: (error) => console.error(error.message), })

Start accepting payments in minutes

Install the SDK, pick your provider, and start charging. It's that simple.

1

Install

npm i @sanwohq/web
2

Pick a provider

npm i @sanwohq/paystack
3

Charge

sanwo({ amount, customer })