npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nexhealth-js-sdk

v1.1.1

Published

An SDK for developing applications using the NexHealth Synchronizer and API.

Readme

NexHealth JS SDK

An unofficial NexHealth JavaScript/TypeScript SDK for developing software with the NexHealth API.

Getting Started

To start with the client, you will want to import NexHealthClient and create a new instance of it. The constructor takes an object with an API key and an optional subdomain.

import { NexHealthClient } from 'nexhealth-js-sdk';

const nexhealth = new NexHealthClient({
  apiKey: 'my-api-key',
  subdomain: 'my-practice-subdomain',
});

Subdomains

The subdomain is cached directly on the client and will automatically be included in any API calls the client makes, if available.

If you ever need to change the subdomain, you can edit it directly or clear it:

nexhealth.subdomain = 'my-other-practice-subdomain';
nexhealth.subdomain = undefined;
nexhealth.clearSubdomain();

Making API Calls

The NexHealthClient object will make asynchronous fetch calls to the specified endpoint. You first specify the version of the NexHealth API you want to call, then the endpoint, and finally the method.

const response = await nexhealth.v2.patients.get(123456789);

The response will be a NexHealthResponse<T> object where T is the type of the data object returned by the NexHealth API (for example, the v2 GET patient endpoint will use the V2.Patient type).

type NexHealthResponse<T> = {
  data: T;
  count?: number;
  page_info?: NexHealthApiPageInfo;
};

The count and page_info values will appear when querying for a list of objects (example: using nexhealth.v2.patients.list()). count will contain the total number of entries and page_info will contain pagination information (structure varies by NexHealth API version).

Methods

Create

Makes a POST request.

Takes query parameters and body parameters:

const response = await nexhealth.v2.patients.create(
  { location_id: 12345 },
  { user: { first_name: 'Jane', last_name: 'Doe', email: '[email protected]' } }
);

Delete

Makes a DELETE request.

Takes the resource ID and optional query parameters:

await nexhealth.v2.appointmentTypes.delete(54321);

Get

Makes a GET request.

Takes the resource ID and optional query parameters:

const response = await nexhealth.v2.patients.get(123456789);

List

Makes a GET request and the data object in the response will always be an array.

Takes query parameters:

const response = await nexhealth.v2.appointments.list({
  start_date: '2026-01-01',
  end_date: '2026-01-31',
  location_id: 12345,
});

The list method response will contain page_info.

ListAll

Makes a GET request and the data object in the response will always be an array.

This is a custom method specific to this SDK. It will automatically paginate through all available pages and return a NexHealthResponse object where data is a combined array of all entries and count is the total number of entries. page_info will not be included.

const response = await nexhealth.v2.appointments.listAll({
  start_date: '2026-01-01',
  end_date: '2026-01-31',
  location_id: 12345,
});

Update

Makes a PATCH request.

Takes the resource ID and body parameters:

const response = await nexhealth.v2.appointments.update(123456789, {
  start_time: '2025-06-01T10:00:00Z',
});

Nested Resources

Some endpoints expose sub-resources as nested objects. These methods take the parent resource ID as their first argument, followed by optional query parameters:

const response = await nexhealth.v2.patients.insuranceCoverages.list(123456789);
const response = await nexhealth.v2.appointments.descriptors.list(987654321);

Error Handling

If the NexHealth API returns an error response (code=false), the NexHealthClient will throw a NexHealthAPIError containing a primary error message, an array of error strings from the NexHealth API response, and a status code.

import { NexHealthClient, NexHealthAPIError } from 'nexhealth-js-sdk';

try {
  const response = await nexhealth.v2.patients.get(123456789);
} catch (error) {
  if (error instanceof NexHealthAPIError) {
    console.error(error.status); // HTTP status code
    console.error(error.message); // primary error message
    console.error(error.errors); // array of error strings from the API
  }
}

Types

All custom types can be imported through an abbreviated version name of the API. All query parameters, body parameters, and response objects are typed.

import { V2, V2024 } from 'nexhealth-js-sdk';

const params: V2.CreatePatientQueryParams = {
  location_id: 12345;
};

Available Endpoints

v2.2.2:

| Endpoint | Methods | | -------------------- | ---------------------------------------------------------------- | | AppointmentSlots | list | | AppointmentTypes | create, delete, get, list, update, descriptors.list | | Appointments | create, get, list, listAll, update, descriptors.list | | Availabilities | create, delete, get, list, listAll, update | | DocumentTypes | get, list | | Institutions | get, list | | Locations | get, list, descriptors.list | | NexStaff | list, listAll | | Operatories | get, list, listAll | | PatientAlerts | create, get, list, update | | PatientDocuments | create, list | | PatientRecalls | get, list, listAll | | Patients | create, get, list, listAll, insuranceCoverages.list | | Procedures | list, listAll | | Providers | get, list, listAll | | RecallTypes | get, list | | SyncStatuses | list | | WebhookEndpoints | create, delete, list, update | | WebhookSubscriptions | create, delete, list, update |

v20240412

| Endpoint | Methods | | -------------------- | --------------------------------------------------------------------------------------- | | AdjustmentTypes | get, list, listAll | | Adjustments | create, get, list, listAll | | Appointments | create, get, list, listAll, update, descriptors.list | | AvailableSlots | list | | Charges | get, list, listAll | | ClinicalNotes | list, listAll | | FeeSchedules | get, list, listAll, procedures.list, procedures.listAll | | GuarantorBalances | get, list, listAll | | InsuranceBalances | get, list, listAll | | InsuranceClaims | get, list, listAll | | InsuranceCoverages | get, list, listAll | | InsurancePlans | get, list, listAll | | Onboardings | create, get, list, listAll | | Operatories | list, listAll | | PatientRecalls | list, listAll | | Patients | create, get, list, listAll | | PaymentTypes | get, list, listAll | | Payments | create, get, list, listAll | | Procedures | get, list, listAll | | ProviderSearch | list | | Providers | get, list, listAll | | TreatmentPlans | get, list, listAll | | WebhookSubscriptions | create, delete, list, update | | WorkingHours | create, delete, get, list, listAll, update, labels.list, labels.listAll |