Skip to content

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.

Notifications You must be signed in to change notification settings

nabla/nabla-connect-sample-app

Repository files navigation

Nabla Connect Demo Server

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.


Quick Start

0. Prerequisites

  • Node.js 18+
  • Yarn
  • A Nabla Connect account (reach out at [email protected] if you need access)

1. Download and install

git clone https://github.com/nabla/nabla-connect-demo-server.git
cd nabla-connect-demo-server
yarn install

2. Create credentials

  1. Follow the Nabla Connect documentation to create an OAuth client (public-key method).
  2. Collect the following values:
    • OAUTH_CLIENT_ID
    • OAUTH_PRIVATE_KEY (PEM string)
    • NABLA_URL for your region
    • NABLA_SIGNATURE_SECRET (shared secret used for webhook signing)
    • Optional defaults for DEFAULT_PROVIDER_ID and DEFAULT_PROVIDER_EMAIL

3. Configure the environment

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

4. Run the server

  • 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.


Endpoints

  • 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
    patientId Yes External patient identifier used by your system.
    patientName No Patient full name; fills encounter metadata.
    patientDob No Patient date of birth (ISO date string).
    patientGender No One of FEMALE, MALE, OTHER, UNKNOWN.
    patientPronouns No One of HE_HIM, SHE_HER, THEY_THEM.
    providerEmail No Email of the provider launching the encounter.
    providerId No External provider identifier; defaults apply.
  • POST /nabla/callback Receives Nabla export callbacks, verifies their signature, and logs formatted notes or patient instructions so you can inspect the payloads during development.


Further reading

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •