We’ve developed an SDK to help you get access to our API without the HTTP plumbing. It’s currently only available for Node-based applications (let us know what other languages you’d like to see it available on).

If you would like to generate your own SDK, you can use our OpenAPI specification to generate client libraries in any language that suits your project needs.

The SDK is available as an NPM package and you can access it here.

To install:

npm install --save @metriport/api-sdk

Initialize it like so:

import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriportClient = new MetriportMedicalApi("YOUR_API_KEY");

Some examples of usage, once the API client is initialized:

// Create a Facility
const patient = await metriportClient.createFacility({
  // facility data
});

// Get a Patient
const patient = await metriportClient.getPatient(patientId);

// List the given Patient's available documents/records
const documents = await metriportClient.listDocuments(patientId, facilityId);

The operations available follow the API specification, with this pattern:

  • GET / endpoints are exposed as list<EntityNameInPlural>()
  • GET /:id endpoints are exposed as get<EntityName>()
  • POST / endpoints are exposed as create<EntityName>()
  • PUT /:id endpoints are exposed as update<EntityName>()
  • DELETE /:id endpoints are exposed as remove<EntityName>()

The client source code contains only the exposed operations and is available here.