lib-bridge-js
Library
Node.js framework for building bridges between HDS and external health data systems.
Features
Section titled “Features”- Express server with clustering, CORS, JSON parsing
- Partner authentication via
partnerAuthTokenheader - Partner user onboarding flow (POST /user/onboard → HDS auth → finalize), mounted only on a bridge with a partner
backend (
partnerAuthTokenset, since 0.14.0) - Bridge account management
PluginBridgebase class to extend- Connector status helpers:
recordConnectorOutcome()writes the user-visiblesync-status/connector-v1event on a connector’s leaf (data-modelsync-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)
Used By
Section titled “Used By”- bridge-chartneo (push model)
- bridge-mira (pull model)
- bridge-tempdrop (pull model)
Tech Stack
Section titled “Tech Stack”- Node.js >= 24, TypeScript (strip-types)
- Express 4, @pryv/boiler config
- Cluster mode for multi-process