Afriex SDK
Welcome to the Afriex SDK documentation. This SDK allows you to integrate the Afriex Business API into your TypeScript/JavaScript applications with ease.
Features
- Type-Safe: Written in TypeScript with full type definitions.
- Modular: Import only what you need from individual packages.
- Resilient: Built-in retry logic and error handling.
- Comprehensive: Covers Customers, Transactions, Payment Methods, Balance, Rates, and Webhooks.
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 a 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({
base: 'USD',
symbols: 'NGN,GBP'
});
console.log(customer, rates);
}
main();Last updated on