0.1.7 • Published 6 months ago
@moneta-network/mo-gateway-sdk v0.1.7
MO Gateway SDK
A type-safe JavaScript/TypeScript SDK for interacting with the MO Gateway API.
Features
- 🔒 Secure Authentication - Built-in API key authentication
- 📦 Type Safety - Written in TypeScript with full type definitions
- 🔄 Automatic Retries - Configurable retry mechanism for failed requests
- 🌐 Cross-Platform - Supports both Node.js and modern browsers
- ⚡ Performance - Built-in request caching and optimization
- 🛠️ Modular Design - Service-based architecture for better organization
- 📝 Comprehensive Logging - Request/Response logging for debugging
Installation
npm install @moneta-network/mo-gateway-sdkQuick Start
import { MOGatewayClient } from '@moneta-network/mo-gateway-sdk';
const client = new MOGatewayClient({
api: {
baseUrl: 'https://mo-portal.domain',
apiPath: 'api/gateway/v1', // Optional
},
auth: {
apiKey: 'API-KEY',
},
request: {
timeoutMs: 5000, // Optional: default 5000ms
maxRetries: 3, // Optional: default 3
retryDelayMs: 1000, // Optional: default 1000ms
},
});
// Example: List Mpass users
const users = await client.mpass.listUsers({
pageSize: 10,
pagePage: 1,
});
// Example: Get MO statement records
const csvData = await client.settlement.getMOStatement({
code: 'BC-2023-10',
});
console.log('Statement data:', csvData);Available Services
The SDK provides several services for different aspects of the MO Gateway:
| Service | Description |
|---|---|
mpass | Manage Mpass users, QR codes, and devices |
userBilling | Handle user billing and charge batches |
settlement | Manage billing cycles and settlements |
Documentation
For detailed documentation, please visit our documentation site.
Contributing
Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the ISC License - see the LICENSE file for details.
Support
For issues and feature requests, please visit our GitHub repository or contact our support team.