NodeJS SDK
The NodeJS SDK enables you to use IntelliProves features with ease.
- NodeJS
This SDK only provides tools for back-end servers. This is due to the requirement of File IO. Our front-end SDK can be found here: https://docs.intelliprove.com/sdk
- NodeJS 16.x
- NodeJS 18.x
- NodeJS 19.x
Support is guaranteed for the NodeJS versions mentioned above. Other versions are most likely supported but not tested.
We provide support for both CommonJS and ESM Node backends. Take note that they do require the use of a different package from NPM. Please make sure that you are installing the correct NPM package for your project.
If you have the line "type": "module" present in your packages.json file, you most likely need to use the ESM version of our SDK.
From the section Functionality onward there is no distinction between the 2 SDKs as they provide the same API and functionality.
We recommend the use of TypeScript as it provides type hints and a better developer experience. However, our SDK works without typescript as well.
You can find our SDK on the node package manager repository for easy installation:
CommonJS:
ESM:
More info on authentication and the API key can be found here: API docs .
For information about the flow to perform a health scan, we recommend going through the Integration guidelines if you haven't already.
Check the quality of a given image before uploading. Returns a QualityResponse object with feedback on whether your video/image is usable and why it might not be usable.
Parameters:
- path: string - path to the image you want to run the quality check on
Return types:
Error options:
Easily upload a video to IntelliProve for analysis of the subject's biomarkers. Returns the uuid of the uploaded video, which can be used to get the results.
NOTE: The quality check (above) needs to be successful before you can upload a video.
Parameters:
- path: str - path to the video you want to process
- quality_response: QualityResponse - the response from the quality check method
- patient: string - An optional field to set the patient reference
- performer: string - An optional field to set the performer reference
Return types:
- uuid: string
Error options:
Returns the results of a processed video for a given uuid as a Biomarkers object.
NOTE: This uses long polling, when demand is high this call can take a while.
Parameters:
- uuid: string - The UUID returned by the upload method
Return types:
Error options:
Get the current customers' information by API key.
Return types:
Error options:
Those are simple representations of the models accessible through the SDK and their helper functions. All models have a .json() method to convert it to a normal JS object in case this is preferred.
Describes the quality of an image.
- success(): boolean - Has the quality check succeeded
Holds the results of an analyzed video after upload.
Contains information about the current user.
- hasEmail(): boolean - Does the have customer a valid email
- isAdmin(): boolean - Is the current customer an administrator for their organization
- isContributor(): boolean - Is the current customer a contributor
- isUser(): boolean - Is the current customer a regular user
This response gets returned by getResults in case your video failed to process and/or we detected an issue with your video. Please refer to the result outcomes for more information about the different types of errors.
Our SDK throws 2 types of exceptions, IntelliProveSDKError and IntelliProveAPIError. All of our exceptions inherit from the base JavaScript Error class.
- Thrown when a request to our API has failed or is invalid (lower level)
- Includes a message about what failed
- Includes the HTTP status code
- Eg. Invalid Authentication (401)
- The body property may be used to provide extra information about the error message.
- Thrown for top-level errors such as wrong parameters, connection errors, etc.
- Includes a message about what went wrong
- Includes ErrorType
- Eg. You do not have an internet connection
Provided with a valid API key and a valid image and video path, this code snippet runs from start to finish and prints out each intermediate result to the console.
An example using then and catch