Skip to content

lib-bridge-js

Library

Node.js framework for building bridges between HDS and external health data systems.

  • Express server with clustering, CORS, JSON parsing
  • Partner authentication via partnerAuthToken header
  • Partner user onboarding flow (POST /user/onboard → HDS auth → finalize), mounted only on a bridge with a partner backend (partnerAuthToken set, since 0.14.0)
  • Bridge account management
  • PluginBridge base class to extend
  • Connector status helpers: recordConnectorOutcome() writes the user-visible sync-status/connector-v1 event on a connector’s leaf (data-model sync-status), isConnectorStatusAccessError() tells a grant that cannot write it
  • Return-URL helpers (isAllowedReturnUrl, normalizeAllowedOrigins, buildRedirectUrl) for redirecting only to configured HDS origins after a partner OAuth
  • Scheduler role across worker respawns: isSchedulerWorker() picks the one worker that runs periodic jobs
  • ensureAppStreamsTree() helper — provisions a {appId}-app/ subtree on a user account in one idempotent call (Plan 25 / Plan 45 §9 convention)
  • bridge-chartneo (push model)
  • bridge-mira (pull model)
  • bridge-tempdrop (pull model)
  • Node.js >= 24, TypeScript (strip-types)
  • Express 4, @pryv/boiler config
  • Cluster mode for multi-process