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

@infoxchange/iss4

v1.0.3

Published

ISS v4 REST API client for Node.js

Downloads

210

Readme

ISS v4 REST API Node.js Client

This package provides a Node.js client for interacting with the ISS v4 REST API. This client has been transpiled from the python client https://github.com/InfoxchangeTS/iss-v4-rest-python-client

Installation

npm install iss-v4-rest-nodejs-client

Usage

Basic Usage

import { ISSV4APIClient } from 'iss-v4-rest-nodejs-client';

// Initialize the client with JWT authentication
const client = new ISSV4APIClient(
  'https://api.example.com/api/',
  {},
  'client_id',
  'client_secret'
);

// Or with Basic token authentication
import { BasicTokenSession } from 'iss-v4-rest-nodejs-client';

const client = new ISSV4APIClient(
  'https://api.example.com/api/',
  { session: BasicTokenSession },
  'your_token'
);

// Directory search provides a simple yet powerfull parameter based method for a simpler search experience
async function simpleSearch() {
  try {
    const results = await client.directorySearch({
      name: 'health services',
      lga: 'city of yarra',
      fields: '*'
    });
    console.log(results);
  } catch (error) {
    console.error('Search failed:', error);
  }
}

// Advanced search is provided via the search endpoint and takes Appsearch based filters and boosts 
async function advancedSearch() {
  try {
    const results = await client.search(
      'search term', 
      { filter_key: 'filter_value' }
    );
    console.log(results);
  } catch (error) {
    console.error('Search failed:', error);
  }
}

// Entity operations example
async function createOrganisation() {
  try {
    const response = await client.createOrganisation({
      name: 'Test Organisation',
      // Other fields...
    });
    console.log('Organisation created:', response.data);
  } catch (error) {
    console.error('Failed to create organisation:', error);
  }
}

Authentication

The client supports two authentication methods:

  1. JWT authentication (default)
  2. Basic token authentication

JWT Authentication

const client = new ISSV4APIClient(
  'https://api.example.com/api/',
  {},
  'client_id',
  'client_secret'
);

Basic Token Authentication

import { BasicTokenSession } from 'iss-v4-rest-nodejs-client';

const client = new ISSV4APIClient(
  'https://api.example.com/api/',
  { session: BasicTokenSession },
  'your_token'
);

Query Parameters

When working with list operations, you can provide query parameters to filter and paginate results:

// Get organisations with pagination
const organisations = await client.organisations(undefined, { limit: '50', offset: '10' });

// Get services with a search term and filters
const services = await client.services(
  { name: 'Health' },  // search term
  { active: 'true' }   // query parameters
);

The client automatically handles various parameter formats, including:

  • String values (e.g., { limit: '50' })
  • Array values (e.g., { limit: ['50'] })
  • Mixed values (e.g., { limit: '50', tags: ['tag1', 'tag2'] })

Note: For array parameters, the client uses the first value in the array when making API requests.

API Reference

The client provides methods for interacting with all the endpoints of the ISS v4 API.

Search Operations

  • search(term, filters, boosts, serialiser, options) - Search ISS v4
  • directorySearch(queryParams) - Directory search with GET parameters
  • searchExplain(term, filters, boosts, serialiser, options) - Explain search query
  • searchElasticsearch(query, params, analyticsQuery, analyticsTags) - Submit an Elasticsearch query
  • multiSearch(queries) - Perform a multi-search
  • querySuggestion(query, options) - Get search suggestions

Organisation Operations

  • organisations(searchTerm, params) - Get a list of organisations
  • organisationExists(entityId) - Check if an organisation exists
  • fetchOrganisation(entityId) - Fetch an organisation
  • createOrganisation(data) - Create an organisation
  • updateOrganisation(entityId, data) - Update an organisation
  • deleteOrganisation(entityId) - Delete an organisation
  • createOrUpdateOrganisation(entityId, data) - Create or update an organisation

Site Operations

  • sites(searchTerm, params) - Get a list of sites
  • siteExists(entityId) - Check if a site exists
  • fetchSite(entityId) - Fetch a site
  • createSite(data) - Create a site
  • updateSite(entityId, data) - Update a site
  • deleteSite(entityId) - Delete a site
  • createOrUpdateSite(entityId, data) - Create or update a site

Service Operations

  • services(searchTerm, params) - Get a list of services
  • serviceExists(entityId) - Check if a service exists
  • fetchService(entityId) - Fetch a service
  • createService(data) - Create a service
  • updateService(entityId, data) - Update a service
  • deleteService(entityId) - Delete a service
  • createOrUpdateService(entityId, data) - Create or update a service
  • fetchServiceType(entityId) - Fetch a service type
  • listServiceTypes(params) - List service types

Event Operations

  • listEvents(queryParams) - List events
  • eventExists(entityId) - Check if an event exists
  • fetchEvent(entityId) - Fetch an event
  • createEvent(data) - Create an event
  • updateEvent(entityId, data) - Update an event
  • deleteEvent(entityId) - Delete an event
  • createOrUpdateEvent(entityId, data) - Create or update an event

Other Operations

  • listAgeGroups(queryParams) - List age groups
  • fetchAgeGroup(entityId) - Fetch an age group
  • listDatasets(queryParams) - List datasets
  • fetchDataset(entityId) - Fetch a dataset
  • listCrisisKeywords(queryParams) - List crisis keywords
  • listRelatedCrisisKeywords(terms) - List related crisis keywords
  • fetchCrisisKeyword(entityId) - Fetch a crisis keyword
  • createCrisisKeyword(data) - Create a crisis keyword
  • deleteCrisisKeyword(entityId) - Delete a crisis keyword
  • listLanguages(queryParams) - List languages
  • fetchLanguage(entityId) - Fetch a language
  • analyticsQueries(options) - Fetch query analytics
  • fetchByExternalId(externalId, organisation) - Fetch by external ID
  • suggest(suggestionType, start) - Get suggestions

Development

Setup

# Install dependencies
yarn install

# Build
yarn run build

# Run tests
yarn test

Testing

The package includes a comprehensive test suite:

# Run all tests
yarn test

# Run with coverage
yarn test -- --coverage