MO Gateway SDK for JavaScript/TypeScript
npm install @moneta-network/mo-gateway-sdk
A type-safe JavaScript/TypeScript SDK for interacting with the MO Gateway API.
- 🔒 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
``bash`
npm install @moneta-network/mo-gateway-sdk
`typescript
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({
search: 'john',
page: { size: 10, page: 1 }
});
// Example: Get a specific user
const user = await client.mpass.getUserById({
userId: 'memb-123'
});
// Example: Get MO statement records
const csvData = await client.settlement.getMOStatement({
code: 'BC-2023-10',
});
console.log('Statement data:', csvData);
`
The SDK provides several services for different aspects of the MO Gateway:
| Service | Description |
|---------|-------------|
| mpass | Manage Mpass users, QR codes, devices, and authentication |userBilling
| | Handle user billing and charge batches |settlement` | Manage billing cycles and settlements |
|
For detailed documentation, please visit our documentation site.
Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the ISC License - see the LICENSE file for details.
For issues and feature requests, please visit our GitHub repository or contact our support team.