Registry / devops / psb_interop-apis-bc-grpc-sync-public-lib

psb_interop-apis-bc-grpc-sync-public-lib

JSON →
library0.6.5jsnpmunverified

Mojaloop vNext gRPC synchronous API service library providing gRPC server/client utilities for the interop-apis bounded context. Current version 0.6.5 (prerelease, active development). Part of the Mojaloop payment interoperability framework. Ships TypeScript types. Requires Node >=20.10.0. Key differentiators: provides synchronous gRPC communication patterns for financial interoperability, tightly coupled with Kafka and JWS authentication. Not yet stable API; breaking changes likely between minor versions.

npm install psb_interop-apis-bc-grpc-sync-public-lib
INSTALL
IMPORT
SIG · PSB_INTEROP-APIS-B
P
psb_interop-apis-bc-grpc-sync-public-lib
devopsjavascriptv0.6.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
import gRPCService from '@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib'
const gRPCService = require('@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib')
ESM-only; no CommonJS support.
type definitions
import type { GrpcConfig, SyncService } from '@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib'
import { GrpcConfig } from '@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib'
Type imports to avoid runtime bundling; compatible with TypeScript >=4.5.
Service class
import { SyncServer } from '@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib'
import SyncServer from '@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib'
SyncServer is a named export, not default.

Instantiate and start the SyncServer with environment-configurable options; shows all required environment variables.

import { SyncServer } from '@mojaloop-poc/interop-apis-bc-grpc-sync-public-lib'; import { config } from './config'; const server = new SyncServer({ port: Number(process.env.SVC_DEFAULT_HTTP_PORT ?? 4000), kafkaUrl: process.env.KAFKA_URL ?? 'localhost:9092', kafkaAuditsTopic: process.env.KAFKA_AUDITS_TOPIC ?? 'audits', kafkaLogsTopic: process.env.KAFKA_LOGS_TOPIC ?? 'logs', auditKeyFilePath: process.env.AUDIT_KEY_FILE_PATH ?? '/app/data/audit_private_key.pem', authNServiceBaseUrl: process.env.AUTH_N_SVC_BASEURL ?? 'http://localhost:3201', participantsServiceUrl: process.env.PARTICIPANTS_SVC_URL ?? 'http://localhost:3010', participantsCacheTimeoutMs: Number(process.env.PARTICIPANTS_CACHE_TIMEOUT_MS ?? 30000), serviceStartTimeoutMs: Number(process.env.SERVICE_START_TIMEOUT_MS ?? 60000), jwsFilesPath: process.env.JWS_FILES_PATH ?? '/app/data/keys/', jwsDisabled: process.env.JWS_DISABLED === 'true', }); await server.start(); console.log('gRPC sync server started');
Debug
Known issues
breakingRenamed from @mojaloop-poc/interop-apis-bc in earlier versions; package name changed at v0.6.0.
fix
Use the new package name @mojaloop-poc/interop-apis-bc-grpc-sync-public-lib and update imports.
affects: <0.6.0
breakingNode.js >=20.10.0 required. Earlier versions cause runtime errors.
fix
Use nvm to install Node 20.10.0 or later: nvm install 20.10.0 && nvm use
affects: >=0.1.0
breakingESM-only package; require() will throw ERR_REQUIRE_ESM.
fix
Use import syntax or dynamic import(). Ensure package.json has "type": "module".
affects: >=0.6.0
gotchaJWS files path must be writable; otherwise startup fails silently.
fix
Set JWS_FILES_PATH to a writable directory and ensure file permissions.
affects: >=0.6.0
gotchaKafka brokers must be reachable at startup; no retry logic for initial connection.
fix
Ensure Kafka is running and KAFKA_URL is correct before starting the service.
affects: >=0.6.0
Errors
Common errors & fixes
node:internal/modules/cjs/loader:1045 throw err; ^ Error [ERR_REQUIRE_ESM]
Using CommonJS require() on an ESM-only package.
fix
Replace require() with import or set "type": "module" in package.json.
TypeError: Cannot read properties of undefined (reading 'start')
Missing or misconfigured environment variables causing SyncServer constructor to fail.
fix
Ensure all required env vars are set (see config example). Validate each variable before passing to new SyncServer().
Error: listen EADDRINUSE: address already in use :::4000
Another process is already using the configured HTTP port.
fix
Change SVC_DEFAULT_HTTP_PORT or kill the existing process using that port.
Upgrade
Version history
0.6.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
psb_interop-apis-bc-grpc-sync-public-lib — npm install psb_interop-apis-bc-grpc-sync-public-lib · libregistry