@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
65 lines (43 loc) • 1.55 kB
Markdown
Official Node.js SDK for interacting with the lomi. payment processing API.
```bash
pnpm add @lomi./sdk
npm install @lomi./sdk
yarn add @lomi./sdk
```
Import the OpenAPI client and configure it with your API key. Then access the different API services.
```typescript
import { OpenAPI, CustomersService, CreateCustomer, type Customer } from '@lomi./sdk';
// Configure your API key (obtainable from your lomi. dashboard)
OpenAPI.HEADERS = {
'X-API-KEY': 'YOUR_LOMI_API_KEY',
};
// Optionally configure the base URL if not using the default production URL
// OpenAPI.BASE = 'https://sandbox.api.lomi.africa/v1';
async function createNewCustomer() {
try {
const customerData: CreateCustomer = {
name: 'Test customer',
email: 'customer@example.com',
phone_number: '+225021234567',
};
const newCustomer: Customer = await CustomersService.createCustomer(customerData);
console.log('Customer created:', newCustomer);
} catch (error) {
console.error('Error creating customer:', error);
}
}
createNewCustomer();
```
Refer to the `src/generated/services` directory and the [lomi. API documentation](https://docs.lomi.africa/docs) for details on available services and methods.
Please refer to the main `CONTRIBUTING.md` in the monorepo.
Contact **hello@lomi.africa** or visit our [support center](https://lomi.africa/support).
This project is licensed under the MIT License.