A minimal Express.js backend that demonstrates how to integrate with Nabla Connect. It handles OAuth-signed launches, validates callbacks, and prints exported content so you can explore the workflow locally.
- Node.js 18+
- Yarn
- A Nabla Connect account (reach out at [email protected] if you need access)
git clone https://github.com/nabla/nabla-connect-demo-server.git
cd nabla-connect-demo-server
yarn install- Follow the Nabla Connect documentation to create an OAuth client (public-key method).
- Collect the following values:
OAUTH_CLIENT_IDOAUTH_PRIVATE_KEY(PEM string)NABLA_URLfor your regionNABLA_SIGNATURE_SECRET(shared secret used for webhook signing)- Optional defaults for
DEFAULT_PROVIDER_IDandDEFAULT_PROVIDER_EMAIL
Copy .env.example to .env and fill in every required field:
NABLA_URL=https://api.nabla.com
NABLA_SIGNATURE_SECRET=your-callback-secret
DEFAULT_PROVIDER_ID=prov-123456
DEFAULT_PROVIDER_EMAIL=[email protected]
OAUTH_CLIENT_ID=client-uuid
OAUTH_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
PORT=4000-
Development (ts-node-dev hot reload):
yarn dev
-
Production build:
yarn build yarn start
Note
The dev server listens on http://localhost:4000 by default. Tunnels such as ngrok let Nabla deliver callbacks to your machine for end-to-end testing.
-
GET /nabla/open/:encounterId
Launches a Nabla encounter using query parameters for patient/provider/whoever context, then redirects the browser to the Nabla-hosted UI.Query param Required Description patientIdYes External patient identifier used by your system. patientNameNo Patient full name; fills encounter metadata. patientDobNo Patient date of birth (ISO date string). patientGenderNo One of FEMALE,MALE,OTHER,UNKNOWN.patientPronounsNo One of HE_HIM,SHE_HER,THEY_THEM.providerEmailNo Email of the provider launching the encounter. providerIdNo External provider identifier; defaults apply. -
POST /nabla/callbackReceives Nabla export callbacks, verifies their signature, and logs formatted notes or patient instructions so you can inspect the payloads during development.
- Nabla Connect documentation: https://nabla-tech.notion.site/nabla-connect-documentation-beta
- OAuth and authentication guide: https://nabla-tech.notion.site/nabla-connect-server-authentication