0.1.8 • Published 7 months ago

@fern-api/metriport v0.1.8

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

Metriport Node Library

npm shield fern shield

The Metriport Node.js library provides access to the Metriport API from JavaScript/TypeScript.

Documentation

API reference documentation is available here.

Installation

npm install --save @fern-api/metriport
# or
yarn add @fern-api/metriport

Usage

Try it out

import { MetriportClient, Metriport } from '@fern-api/metriport';

const metriport = new MetriportClient({
    apiKey: 'YOUR_API_KEY',
});

const response = await metriport.medical.organization.create({
  type: Metriport.OrgType.PostAcuteCare,
  name: "Metriport Inc.",
  location: {
    addressLine1: "2261 Market Street",
    addressLine2: "#4818",
    city: "San Francisco",
    state: Metriport.UsState.CA,
    zip: "94114",
    country: "USA",
  }
});

console.log('Received response from Metriport!', response);

Handling errors

When the API returns a non-success status code (4xx or 5xx response), a subclass of MetriportError will be thrown:

import { MetriportError } from '@fern-api/metriport';

try {
  await metriport.medical.patients.get("patient-id");
} catch (err) {
  if (err instanceof MetriportError) {
    console.log(err.statusCode);
    console.log(err.message);
    console.log(err.body); 
  }
}

Beta status

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your package.json file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

0.1.2

8 months ago

0.1.1

8 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago