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

@harnessio/react-ccm-service-client

v0.4.4

Published

Harness CCM Service APIs integrated with react hooks

Readme

React CCM Service Client

OpenAPI -> OA

TypeScript -> TS

OpenAPI + TypeScript -> OATS

This React API client stores a collection of Harness CCM (Cloud Cost Management) Service APIs and interface contracts generated from an OpenAPI spec using OATS CLI. APIs are exposed as hooks built on @tanstack/react-query.

Build

yarn build

Initializing the Client

Before using any hook, initialize CCMServiceAPIClient with your auth and URL configuration:

import { CCMServiceAPIClient } from '@harnessio/react-ccm-service-client';

new CCMServiceAPIClient({
  urlInterceptor: (url) => `${window.apiUrl}/${url}`,
  getRequestHeaders: () => ({
    Authorization: `Bearer ${yourToken}`,
    'Harness-Account': accountId,
  }),
  requestInterceptor: (request) => {
    // optionally modify the Request object before it is sent
    return request;
  },
  responseInterceptor: (res) => {
    if (res.status === 401) {
      window.dispatchEvent(new CustomEvent('PROMISE_API_RESPONSE', { detail: { response: res } }));
    }
    return res;
  },
});

Updating Headers at Runtime

The client instance exposes updateHeaders to patch headers after initialization (e.g. after a token refresh):

const client = new CCMServiceAPIClient({ ... })

// later, when the token changes:
client.updateHeaders({ Authorization: `Bearer ${newToken}` })

CCM UI Integration

CCM UI uses restful-react today. To adopt this package you need three one-time changes:

| Change | Where | Required | | ------------------------------------- | ---------------------------- | ---------------------------------- | | yarn add @tanstack/react-query | CCM UI package.json | Yes — peer dependency | | Wrap app with <QueryClientProvider> | App.tsx or bootstrap.tsx | Yes — hooks won't work without it | | Call new CCMServiceAPIClient(...) | App init / bootstrap | Yes — fetcher throws if not called |

Minimal bootstrap example

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { CCMServiceAPIClient } from '@harnessio/react-ccm-service-client';

new CCMServiceAPIClient({
  urlInterceptor: (url) => `${window.apiUrl}/${url}`,
  getRequestHeaders: () => ({ Authorization: `Bearer ${token}`, 'Harness-Account': accountId }),
  responseInterceptor: (res) => {
    window.dispatchEvent(new CustomEvent('PROMISE_API_RESPONSE', { detail: { response: res } }));
    return res;
  },
});

const queryClient = new QueryClient();

export default function Root() {
  return (
    <QueryClientProvider client={queryClient}>
      <App />
    </QueryClientProvider>
  );
}

Local Development with yalc

Use yalc to test local changes in CCM UI before publishing.

Step 1 — Build and publish to the local yalc store:

cd packages/ccm-service
yarn build
yalc publish

Step 2 — Add to CCM UI:

cd /path/to/ccm-ui
yalc add @harnessio/react-ccm-service-client
yarn install
yarn add @tanstack/react-query   # if not already present

Step 3 — Sync after rebuilding:

# in packages/ccm-service:
yarn build && yalc push

Remove the yalc link when done:

cd /path/to/ccm-ui
yalc remove @harnessio/react-ccm-service-client
yarn install

Versioning

@harnessio/react-ccm-service-client

Versioning is driven by the OpenAPI spec. Do not manually edit files under src/services/ — run yarn generate after updating openapi.json.

License

MIT. Copyright(c) Harness Inc