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

@the-hashgraph-group-ag/identity-client-sdk-js-core

v0.6.0

Published

Core utilities and HTTP client for Identity Client SDK

Readme

Core Package

Core utilities and HTTP client for the Identity Client SDK.

Features

  • HTTP Client: Modern HTTP client with interceptors
  • Type Safety: Full TypeScript support
  • Interceptors: Request/response middleware support
  • Error Handling: Built-in HTTP error handling with standardized error classes
  • Validation: Input validation utilities with typed errors

Installation

pnpm add @the-hashgraph-group-ag/identity-client-sdk-js-core

Usage

Basic HTTP Client

import { HttpClient } from '@the-hashgraph-group-ag/identity-client-sdk-js-core';

const client = new HttpClient({
  baseUrl: 'https://api.example.com',
  defaultHeaders: {
    'User-Agent': 'MyApp/1.0',
  },
});

// GET request
const response = await client.get('/users');

// POST request
const newUser = await client.post('/users', {
  name: 'John Doe',
  email: '[email protected]',
});

With Interceptors

import {
  HttpClient,
  jsonHeaders,
  withAuth,
  throwOnHttpError,
} from '@the-hashgraph-group-ag/identity-client-sdk-js-core';

const client = new HttpClient({
  baseUrl: 'https://api.example.com',
  requestInterceptors: [jsonHeaders, withAuth(() => 'your-token-here')],
  responseInterceptors: [throwOnHttpError],
});

Custom Interceptors

import {
  HttpClient,
  RequestInterceptor,
  ResponseInterceptor,
} from '@the-hashgraph-group-ag/identity-client-sdk-js-core';

const loggingInterceptor: RequestInterceptor = (ctx) => {
  console.log(`Making ${ctx.request.method} request to ${ctx.request.url}`);
};

const client = new HttpClient({
  requestInterceptors: [loggingInterceptor],
});

API Reference

HttpClient

Main HTTP client class.

Constructor Options

  • baseUrl: Base URL for all requests
  • defaultHeaders: Default headers for all requests
  • requestInterceptors: Array of request interceptors
  • responseInterceptors: Array of response interceptors

Methods

  • get<T>(url, query?, headers?): Make GET request
  • post<T>(url, body?, headers?): Make POST request
  • put<T>(url, body?, headers?): Make PUT request
  • patch<T>(url, body?, headers?): Make PATCH request
  • delete<T>(url, headers?): Make DELETE request
  • request<T>(req): Make custom request

Built-in Interceptors

  • jsonHeaders: Adds JSON content-type headers
  • withAuth(getToken): Adds Authorization header
  • throwOnHttpError: Throws error for HTTP 4xx/5xx responses

Error Classes

The SDK provides standardized error classes for consistent error handling:

HTTP Errors

  • HttpError: HTTP request errors with status code, data, and headers
  • TimeoutError: Request timeout errors
  • NetworkError: Network connectivity errors
  • AbortedError: Request aborted errors
  • RetryableError: Retryable errors

SDK Errors

  • ValidationError: Input validation errors with field information
  • ConfigurationError: SDK configuration errors
  • HandlerNotSetError: Handler not configured errors

Example:

import { ValidationError, HttpError } from '@the-hashgraph-group-ag/identity-client-sdk-js-core';

try {
  await handler.createIssuanceRequest(params);
} catch (error) {
  if (error instanceof ValidationError) {
    console.error('Validation error:', error.message, 'Field:', error.field);
  } else if (error instanceof HttpError) {
    console.error('HTTP error:', error.status, error.message);
  }
}

License

MIT License