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

@hmcts/cui-client

v1.0.0

Published

Reusable HMCTS CUI API client

Readme

@hmcts/cui-client

Node.js Package

Small TypeScript client for the HMCTS CUI API.

Install

npm install @hmcts/cui-client axios

Usage

CUIClient accepts a required CUIClientConfig object and an optional CUIClientOptions object.

import {
  CUIClient,
  type CUIStartJourneyRequest,
  type CUIStartJourneyAuth,
} from '@hmcts/cui-client';

const client = new CUIClient({
  endpoint: 'https://cui-api.internal.hmcts.net',
  hmctsServiceId: 'your-service-id',
  logoutUrl: 'https://your-app/logout',
});

const request: CUIStartJourneyRequest = {
  callbackUrl: 'https://your-app/callback',
  correlationId: 'a-correlation-id',
  language: 'en',
  masterFlagCode: 'RA0042',
  existingFlags: {
    partyName: 'Jane Doe',
    roleOnCase: 'Applicant',
    details: [],
  },
};

const auth: CUIStartJourneyAuth = {
  idamToken: 'idam-access-token',
  serviceToken: 'service-token',
};

const { url } = await client.startJourney(request, auth);
import { CUIClient, type CUIClientAuth } from '@hmcts/cui-client';

const client = new CUIClient({
  endpoint: 'https://cui-api.internal.hmcts.net',
  hmctsServiceId: 'your-service-id',
});

const auth: CUIClientAuth = {
  serviceToken: 'service-token',
};

const journey = await client.getJourneyData('journey-id', auth);

To pass custom axios request options such as timeouts or a self-signed HTTPS agent:

import { Agent } from 'https';
import { CUIClient, type CUIClientOptions } from '@hmcts/cui-client';

const options: CUIClientOptions = {
  axiosConfig: {
    timeout: 10000,
    httpsAgent: new Agent({
      rejectUnauthorized: false,
    }),
  },
};

const client = new CUIClient({
  endpoint: 'https://cui-api.internal.hmcts.net',
  hmctsServiceId: 'your-service-id',
}, options);

These request options are applied whether the client uses the built-in axios instance or a custom httpClient.

Use relaxed TLS settings only in test or non-production environments.

Public API

  • CUIClient
  • CUIConfigError
  • CUIRequestError
  • CUIYesNo
  • CUIFlagPath
  • CUIFlag
  • CUIFlagItem
  • CUIFlagDetails
  • CUIStartJourneyRequest
  • CUIJourneyData
  • CUIStartJourneyResponse
  • CUIClientAuth
  • CUIStartJourneyAuth
  • CUIClientConfig
  • CUIClientOptions

Development

npm run build
npm run typecheck
npm test

CI and publishing are handled by .github/workflows/npm_build.yml.

Release Process

  1. Update the package version.
npm version patch

Use minor or major instead of patch when appropriate.

  1. Push the version commit and tag.
git push origin main --follow-tags
  1. Create a GitHub Release from the pushed tag.

If the GitHub Release is marked as a prerelease, the workflow publishes to npm with the next dist-tag. Otherwise it publishes with latest.

The publish step uses npm Trusted Publishing with GitHub Actions OIDC. It does not use an NPM_TOKEN.

GitHub And npm Setup

  • GitHub Actions must be enabled for this repository.
  • npm Trusted Publishing must be configured for this GitHub repository and the npm_build.yml workflow filename.
  • The npm package @hmcts/cui-client must exist in the target npm organisation/account.
  • Creating a GitHub Release is the publishing trigger; pushes and pull requests only run validation.