> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metriport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Software Development Kit

> How to access the Medical API using our SDK

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](https://www.metriport.com/contact-us) what other languages you'd like to see it available on).

<Info>
  If you would like to generate your own SDK, you can use our [OpenAPI
  specification](/medical-api/api-tools/open-api) to generate client libraries in any language that
  suits your project needs.
</Info>

The SDK is available as an NPM package and you can access it [here](https://www.npmjs.com/package/@metriport/api-sdk).

To install:

```shell theme={null}
npm install --save @metriport/api-sdk
```

Initialize it like so:

<Snippet file="medical-api-init.mdx" />

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

```typescript theme={null}
// 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](/medical-api/api-reference/facility/create-facility),
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](https://github.com/metriport/metriport/blob/develop/packages/api-sdk/src/medical/client/metriport.ts).
