@lomi./sdk
v1.5.9
Published
Official TypeScript SDK for the lomi. API
Maintainers
Readme
lomi. TypeScript SDK
Official Node.js SDK for interacting with the lomi. payment processing API.
Installation
# Using pnpm
pnpm add @lomi./sdk
# Using npm
npm install @lomi./sdk
# Using yarn
yarn add @lomi./sdkUsage
Import the OpenAPI client and configure it with your API key. Then access the different API services.
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: '[email protected]',
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 for details on available services and methods.
Contributing
Please refer to the main CONTRIBUTING.md in the monorepo.
Support
Contact [email protected] or visit our support center.
License
This project is licensed under the MIT License.
