SDKs & Libraries
Production-ready SDKs and libraries for every platform and programming language. Build powerful payment experiences with minimal code.
11.7K
Total Downloads
305
GitHub Stars
420+
Active Developers
10+
Languages Supported
Python SDK
Python
Pythonic SDK with smart transport selection (REST for sandbox, gRPC for production) and support for Django, Flask, and FastAPI frameworks
Installation
pip install swiftdime-pythonKey Features
Quick Start
import swiftdime
import time
# Server-side β secret key only, never expose in client code
client = swiftdime.Client('fl_sk_test_your-sandbox-secret-key')
payment = client.payments.create(
tx_ref=f'ORDER-{int(time.time())}',
amount=100.00,
currency='ZMW',
customer: {
email: 'customer@example.com',
name: 'John Doe',
phone_number: +260971234567
}
payment_methods=['mobile_money', 'card'],
callback_url='https://yoursite.com/webhook',
redirect_url='https://yoursite.com/success',
metadata={'order_id': 'ORD-12345'}
)
print(f"Checkout URL: {payment.data.checkout_url}")PHP Laravel SDK
PHP
Pure gRPC client for Laravel with enterprise-grade performance (100k+ RPS capable) and dual environment support
Installation
composer require swiftdime/laravel-sdkKey Features
Quick Start
<?php
use SwiftDime\Laravel\SwiftDimeClient;
// Server-side β secret key only, stored in config/swiftdime.php
$client = new SwiftDimeClient(config('swiftdime.secret_key'));
$payment = $client->payments->create([
'tx_ref' => 'ORDER-' . uniqid(),
'amount' => 100.00,
'currency' => 'ZMW',
customer: => {
email: 'customer@example.com',
name: 'John Doe',
phone_number: +260971234567
}
'payment_methods' => ['mobile_money', 'card'],
'callback_url' => route('payment.webhook'),
'redirect_url' => route('transaction.completed'),
]);
return redirect($payment['data']['checkout_url']);Go SDK
Go
High-performance Go SDK with smart transport selection (REST for sandbox, gRPC for production) and context support
Installation
go get github.com/swiftdime/go-sdkKey Features
Quick Start
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/swiftdime/go-sdk"
)
func main() {
// Server-side β secret key only, loaded from environment
client := swiftdime.NewClient(swiftdime.Config{
SecretKey: "fl_sk_test_your-sandbox-secret-key",
Environment: swiftdime.EnvironmentSandbox,
})
ctx := context.Background()
payment, err := client.Payments.Create(ctx, swiftdime.CreatePaymentRequest{
TxRef: fmt.Sprintf("ORDER-%d", time.Now().Unix()),
Amount: 100.0,
Currency: "ZMW",
CustomerEmail: "customer@example.com",
CustomerName: "John Doe",
PaymentMethods: []string{"mobile_money", "card"},
CallbackURL: "https://yoursite.com/webhook",
RedirectURL: "https://yoursite.com/success",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Checkout URL: %s\n", payment.Data.CheckoutURL)
}React SDK
React
Modern hook-based React SDK with SwiftDime-style API and smart transport selection
Installation
npm install @swiftdime/react-sdkKey Features
Quick Start
import React from 'react';
import { useSwiftDime } from '@swiftdime/react-sdk';
// Client-side: only the public key goes in browser code
function CheckoutButton({ txRef, amount }) {
const { openCheckout, loading } = useSwiftDime({
publicKey: process.env.NEXT_PUBLIC_SWIFTDIME_PUBLIC_KEY, // fl_pk_test_...
});
return (
<button
onClick={() => openCheckout({ txRef, amount, currency: 'ZMW' })}
disabled={loading}
>
{loading ? 'Opening...' : 'Pay Now'}
</button>
);
}Vue SDK
Vue.js
Modern Composition API-based Vue 3 SDK with SwiftDime-style API and reactive composables
Installation
npm install @swiftdime/vue-sdkKey Features
Quick Start
<script setup>
import { useSwiftDime } from '@swiftdime/vue-sdk';
// Client-side: only the public key goes in browser code
const { openCheckout, loading } = useSwiftDime({
publicKey: import.meta.env.VITE_SWIFTDIME_PUBLIC_KEY, // fl_pk_test_...
});
async function handlePayment() {
// Your server creates the payment first and returns a txRef
const res = await fetch('/api/payments', { method: 'POST' });
const { txRef } = await res.json();
openCheckout({
txRef,
amount: 100.00,
currency: 'ZMW',
customer: {
email: 'customer@example.com',
name: 'John Doe',
phone_number: +260971234567
}
});
}
</script>
<template>
<button @click="handlePayment" :disabled="loading">
{{ loading ? 'Opening...' : 'Pay ZMW 100.00' }}
</button>
</template>Ready to start building?
Get started with SwiftDime SDKs today. Join thousands of developers building amazing payment experiences with our tools.