0.1.0 • Published 6 months ago

@moneta_network/mo-gateway-sdk v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

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-sdk

Quick Start

import { MOGatewayClient } from '@moneta_network/mo-gateway-sdk';

const client = new MOGatewayClient({
  api: {
    baseUrl: process.env.API_BASE_URL || 'http://localhost:3000',
    apiPath: 'api/gateway/v1',
  },
  auth: {
    apiKey: process.env.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,
});

Available Services

The SDK provides several services for different aspects of the MO Gateway:

ServiceDescription
mpassManage Mpass users, QR codes, and devices
userBillingHandle user billing and charge batches
settlementManage 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.

0.1.0

6 months ago