@mojaloop/mcm-client
v4.1.2
Published
Client service for Connection Manager API
Keywords
Readme
MCM Client
TypeScript client for managing certificates and configuration with the Mojaloop Connection Manager. Automatically handles cert lifecycle, renewals, and Hub synchronization using HashiCorp Vault.
Installation
npm install @mojaloop/mcm-clientUsage
const { ConnectionStateMachine, Vault } = require('@mojaloop/mcm-client');
const vault = new Vault({
endpoint: 'https://vault.example.com',
auth: { k8s: { role: 'dfsp-role', jwt: token } }
});
const machine = ConnectionStateMachine.create({
logger: yourLogger,
vault: vault,
refreshIntervalSeconds: 300,
certExpiryThresholdDays: 30
});
machine.start();What it manages
- DFSP and Hub certificates (CA, client, server)
- JWS key generation and peer sync
- Endpoint and connector configuration
- Real-time updates via WebSocket
Uses XState to run 11 parallel workflows. State persists to Vault so it survives restarts. Certificates auto-renew before expiration.
Development
npm run build # Compile
npm test # Run tests
npm run lint # Check code style