- Install the required packages:
npm install - In
app.jsadd your private Getlabs dev API token and client id for :const getlabsConfig = { apiToken: 'eyJpZCI6IjExMmE3NzhlLTBhNTQtNGNmOS05MzkwLWUxYjdjNGWIrYlBXSWl6MnhpcVZlZ2NKL0o5dGM9In0=', clientId: '733ae0db-360d-46ec-89e7-645aa9fab2dd' ... }
- Start the application on the default port 3000:
To start the application on a different port set the
node app.jsPORTenvironment variable:PORT=3001 node app.js
The application works with a single hardcoded user to simulate a user logged into your platform.
The user details can be modified in app.js:
const loggedInUser = {
"email": "test@getlabs.io",
"dob": "1970-01-01",
"birthSex": "female",
"phoneNumber": "6022370549",
"firstName": "Test",
"lastName": "Patient"
}NOTE: The patient's email, date of birth and birth sex must match a patient or app.js will throw startup errors.
Stripe offers several credit cards for testing both successful and error responses: https://stripe.com/docs/testing
If you'd like to test the API via Postman or another 3rd-party tool, you can generate a signed JWT token for the /oauth/token endpoint by running the included jwt-token.html utility in your browser.
This repo is not actively maintained, and this code does not run in production in Getlabs' infrastructure. Hence, we've disabled Dependabot for this repo. If you decide to use this code as the basis of your own code, you are responsible for patching your own code.