S
Sanwo

“Sánwó” — pay money (Yorùbá)

Documentation
Free & open source

One integration. Every payment provider.

Open-source infrastructure for integrating payment gateways.

import { createSanwo }  from '@sanwohq/web'import { paystackProvider }  from '@sanwohq/paystack' const sanwo = createSanwo({  provider: paystackProvider,  publicKey: 'pk_test_...'}) await sanwo({ amount: 500000, currency: 'NGN' })
import { SanwoReactProvider, useSanwoCheckout }  from '@sanwohq/react'import { paystackProvider }  from '@sanwohq/paystack' <SanwoReactProvider provider={paystackProvider} publicKey='pk_test_...'>  <PayButton /></SanwoReactProvider> const { checkout, isLoading } = useSanwoCheckout()await checkout({ amount: 500000, currency: 'NGN' })
import { SanwoPlugin, useSanwoCheckout }  from '@sanwohq/vue'import { paystackProvider }  from '@sanwohq/paystack' app.use(SanwoPlugin, {  provider: paystackProvider,  publicKey: 'pk_test_...'}) const { checkout, isLoading } = useSanwoCheckout()await checkout({ amount: 500000, currency: 'NGN' })
import { createSanwoContext, createSanwoCheckout }  from '@sanwohq/svelte'import { paystackProvider }  from '@sanwohq/paystack' const ctx = createSanwoContext({  provider: paystackProvider,  publicKey: 'pk_test_...'}) const { checkout, isLoading } = createSanwoCheckout()await checkout({ amount: 500000, currency: 'NGN' })
import { createSanwo }  from '@sanwohq/web'import { paystackProvider }  from '@sanwohq/paystack' const sanwo = createSanwo({  provider: paystackProvider,  publicKey: 'pk_test_...'}) await sanwo({ amount: 500000, currency: 'NGN' })
import { SanwoProvider, useSanwoCheckout }  from '@sanwohq/react-native'import { paystackProvider }  from '@sanwohq/paystack' <SanwoProvider provider={paystackProvider} publicKey='pk_test_...'>  <CheckoutScreen /></SanwoProvider> const { checkout, isLoading } = useSanwoCheckout()await checkout({ amount: 500000, currency: 'NGN' })
import 'package:sanwo_flutter/sanwo_flutter.dart'import 'package:sanwo_paystack/sanwo_paystack.dart' final sanwo = Sanwo(  provider: paystackProvider,  publicKey: 'pk_test_...',); await sanwo.checkout(context, options)
import Sanwoimport SanwoPaystack let sanwo = Sanwo(  provider: paystackProvider,  publicKey: "pk_test_...") sanwo.checkout(options) { result in }
import com.sanwohq.android.Sanwoimport com.sanwohq.paystack.paystackProvider val sanwo = Sanwo(  provider = paystackProvider,  publicKey = "pk_test_...") sanwo(activity, options) { result -> }

Why Sanwo

Why not just use the provider SDKs?

Provider SDKs

Locked to one provider
Different API per gateway
Rewrite when migrating
Closed source
No custom provider support

Sanwo

Switch providers instantly
One unified API
Zero rewrites
Fully open source
Build your own provider
Open Source
Type Safe
Framework Agnostic
Provider Independent
Custom Providers

Providers

Growing list of providers, one interface

From Lagos to Mumbai to San Francisco. 5 providers today, with more on the way.

P

Paystack

Africa
@sanwohq/paystack

NGN, GHS, ZAR, USD

F

Flutterwave

Africa
@sanwohq/flutterwave

NGN, GHS, KES, USD, +30

R

Razorpay

India
@sanwohq/razorpay

INR, USD

M

Monnify

Nigeria
@sanwohq/monnify

NGN

I

Interswitch

Nigeria
@sanwohq/interswitch

NGN, USD

+

Your Provider

Don't see your provider? Build a custom one with a simple HTML template.

Read the Guide

Developer experience

Simple by default, powerful when you need it

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

Amounts in minor units

Pass amounts in kobo, cents, or paise. Sanwo handles conversion for providers that expect major units.

Typed results everywhere

Every checkout returns a structured result — successful, cancelled, or failed. On every platform.

Auto-generated references

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

Same API, every platform

The same provider, options, and result pattern works across Web, React, Vue, Svelte, Angular, Flutter, iOS, and Android.

import { createSanwo }  from '@sanwohq/web'import { paystackProvider }  from '@sanwohq/paystack' const sanwo = createSanwo({  provider: paystackProvider,  publicKey: 'pk_test_...'}) const result = await sanwo({  amount: 500000,  // 5,000.00 in minor units  currency: 'NGN',  customer: { email: 'user@example.com' },})
import { SanwoReactProvider, useSanwoCheckout }  from '@sanwohq/react'import { paystackProvider }  from '@sanwohq/paystack' // Wrap your app with SanwoReactProvider<SanwoReactProvider  provider={paystackProvider}  publicKey='pk_test_...'>  <PayButton /></SanwoReactProvider> // Then use the hook in any childfunction PayButton() {  const { checkout, isLoading } = useSanwoCheckout()   const handlePay = () => checkout({    amount: 500000,    // 5,000.00 in minor units    currency: 'NGN',    customer: { email: 'user@example.com' },  })   return (    <button onClick={handlePay}>      {isLoading ? 'Processing...' : 'Pay'}    </button>  )}
import { SanwoPlugin, useSanwoCheckout }  from '@sanwohq/vue'import { paystackProvider }  from '@sanwohq/paystack' // Register plugin in main.tsapp.use(SanwoPlugin, {  provider: paystackProvider,  publicKey: 'pk_test_...'}) // Use composable in any componentconst { checkout, isLoading } = useSanwoCheckout() const result = await checkout({  amount: 500000,  // 5,000.00 in minor units  currency: 'NGN',  customer: { email: 'user@example.com' },})
import { createSanwoContext, createSanwoCheckout }  from '@sanwohq/svelte'import { paystackProvider }  from '@sanwohq/paystack' // Set up context in parent componentcreateSanwoContext({  provider: paystackProvider,  publicKey: 'pk_test_...'}) // Use checkout store in any childconst { checkout, isLoading } = createSanwoCheckout() const result = await checkout({  amount: 500000,  // 5,000.00 in minor units  currency: 'NGN',  customer: { email: 'user@example.com' },})
import { createSanwo }  from '@sanwohq/web'import { paystackProvider }  from '@sanwohq/paystack' // Create instance in your componentsanwo = createSanwo({  provider: paystackProvider,  publicKey: 'pk_test_...'}) // Call in event handlerconst result = await this.sanwo({  amount: 500000,  // 5,000.00 in minor units  currency: 'NGN',  customer: { email: 'user@example.com' },})
import { SanwoProvider, useSanwoCheckout }  from '@sanwohq/react-native'import { paystackProvider }  from '@sanwohq/paystack' // Wrap your app with SanwoProvider<SanwoProvider  provider={paystackProvider}  publicKey='pk_test_...'>  <CheckoutScreen /></SanwoProvider> // Then use the hook in any childfunction CheckoutScreen() {  const { checkout, isLoading } = useSanwoCheckout()   const handlePay = async () => {    const result = await checkout({      amount: 500000,      // 5,000.00 in minor units      currency: 'NGN',      customer: { email: 'user@example.com' },    })  }   return <Button title='Pay' onPress={handlePay} />}
import 'package:sanwo_flutter/sanwo_flutter.dart'import 'package:sanwo_paystack/sanwo_paystack.dart' final sanwo = Sanwo(  provider: paystackProvider,  publicKey: 'pk_test_...',); final result = await sanwo.checkout(  context,  CheckoutOptions(    amount: 500000,    // 5,000.00 in minor units    currency: 'NGN',    customer: CheckoutCustomer(      email: 'user@example.com',    ),  ),);
import Sanwoimport SanwoPaystack let sanwo = Sanwo(  provider: paystackProvider,  publicKey: "pk_test_...") let options = CheckoutOptions(  amount: 500000,  // 5,000.00 in minor units  currency: "NGN",  customer: CheckoutCustomer(    email: "user@example.com"  )) sanwo.checkout(options) { result in  // handle .successful, .cancelled, .failed}
import com.sanwohq.android.Sanwoimport com.sanwohq.paystack.paystackProvider val sanwo = Sanwo(  provider = paystackProvider,  publicKey = "pk_test_...") val options = CheckoutOptions(  amount = 500000,  // 5,000.00 in minor units  currency = "NGN",  customer = CheckoutCustomer(    email = "user@example.com"  )) sanwo(activity, options) { result ->  // handle Successful, Cancelled, Failed}

SDKs

Native SDKs for every platform

Same providers, same API pattern. Pick the SDK for your platform.

Web / JavaScript

Works with Angular and any web framework

$ npm i @sanwohq/web @sanwohq/paystack

React

SanwoReactProvider + useSanwoCheckout hook. Works with Next.js

$ npm i @sanwohq/react @sanwohq/paystack

Vue

SanwoPlugin + composables. Works with Nuxt

$ npm i @sanwohq/vue @sanwohq/paystack

Svelte

Context + stores. Works with SvelteKit

$ npm i @sanwohq/svelte @sanwohq/paystack

Angular

Uses @sanwohq/web directly. Angular 16+

$ npm i @sanwohq/web @sanwohq/paystack

React Native

SanwoProvider + useSanwoCheckout hook for React Native apps

$ npm i @sanwohq/react-native @sanwohq/paystack

Flutter / Dart

Native Flutter SDK with provider plugins on pub.dev

$ flutter pub add sanwo_flutter sanwo_paystack

iOS / Swift

Native Swift SDK distributed via Swift Package Manager

$ github.com/Sanwohq/ios from: "0.1.2"

Android / Kotlin

Native Kotlin SDK distributed via JitPack

$ com.github.Sanwohq.android:sanwo:0.1.1

Laravel

Blade components for checkout buttons and custom amounts

$ composer require sanwohq/laravel

Python

Django, Flask, and FastAPI integrations or standalone client

$ pip install sanwo

Go

Generate checkout HTML with net/http, Gin, Echo, or any Go framework

$ go get github.com/Sanwohq/go

Ruby

Rails view helper or standalone client for any Ruby app

$ gem install sanwo

.NET / C#

ASP.NET Tag Helpers for Razor views with DI configuration

$ dotnet add package Sanwo

Open Source

Contribute to Sanwo

Sanwo is community-driven. Add support for any payment provider by submitting a PR with an HTML template — no complex setup, no server-side code.

1. Copy the template

Each provider is a small folder with an HTML template and metadata. Start from our starter template.

2. Add your provider

Load the payment gateway's JS SDK, handle the checkout flow, and report results back to Sanwo.

3. Submit a PR

CI runs conformance tests automatically. Once merged, your provider is published to npm for everyone.

Quick start

Start accepting payments in minutes

Install the SDK, pick your provider, and start charging — on every platform.

1

Install

npm i @sanwohq/web
2

Pick a provider

npm i @sanwohq/paystack
3

Charge

sanwo({ amount, customer })
1

Install

npm i @sanwohq/react
2

Pick a provider

npm i @sanwohq/paystack
3

Wrap with Provider

<SanwoReactProvider>
4

Use the hook

useSanwoCheckout()
1

Install

npm i @sanwohq/vue
2

Pick a provider

npm i @sanwohq/paystack
3

Register plugin

app.use(SanwoPlugin, { ... })
4

Use composable

useSanwoCheckout()
1

Install

npm i @sanwohq/svelte
2

Pick a provider

npm i @sanwohq/paystack
3

Create context

createSanwoContext({ ... })
4

Use store

createSanwoCheckout()
1

Install

npm i @sanwohq/web
2

Pick a provider

npm i @sanwohq/paystack
3

Charge

sanwo({ amount, customer })
1

Install

npm i @sanwohq/react-native
2

Pick a provider

npm i @sanwohq/paystack
3

Wrap with Provider

<SanwoProvider>
4

Use the hook

useSanwoCheckout()
1

Install

flutter pub add sanwo_flutter
2

Add provider

flutter pub add sanwo_paystack
3

Charge

sanwo.checkout(ctx, options)
1

Add package

github.com/Sanwohq/ios
2

Import

import SanwoPaystack
3

Charge

sanwo.checkout(options)
1

Add JitPack

maven { url 'jitpack.io' }
2

Add SDK

Sanwohq.android:sanwo:0.1.1
3

Charge

sanwo(activity, options)