Afriex SDK
TypeScript SDK for the Afriex Business API.
Features
- Type-safe TypeScript with full definitions
- Modular imports from individual packages
- Resilient retry logic and error handling
- Complete coverage: customers, transactions, payment methods, balance, rates, webhooks, checkout
Installation
npm install @afriex/sdk
# or
pnpm add @afriex/sdkQuick Start
import { AfriexSDK } from "@afriex/sdk";
const afriex = new AfriexSDK({
apiKey: "YOUR_API_KEY",
environment: "staging", // or 'production'
});
async function main() {
// Create customer
const customer = await afriex.customers.create({
fullName: "John Doe",
email: "john@example.com",
phone: "+1234567890",
countryCode: "US",
});
// Get exchange rates
const rates = await afriex.rates.getRates({
fromSymbols: "USD",
toSymbols: "NGN,GBP",
});
console.log(customer, rates);
}
main();