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

@hashgraph/sdk

v2.80.0

Published

Hiero SDK

Downloads

407,046

Readme

Hiero JavaScript SDK

Docs JSDoc NPM Package OpenSSF Scorecard CII Best Practices License

The JavaScript SDK for interacting with a Hiero based network

[!NOTE]
The project has been transfered from the https://github.com/hashgraph org and therefore the namespace is at several locations still based on hashgraph and hedera. We are working activly on migration the namespace fully to hiero.

Install

NOTE: v1 of the SDK is deprecated and support will be discontinued after October 2021. Please install the latest version 2.x or migrate from v1 to the latest 2.x version. You can reference the migration documentation.

# with NPM
$ npm install --save @hiero-ledger/sdk

# with Yarn
$ yarn add @hiero-ledger/sdk

# with PNPM
$ pnpm add @hiero-ledger/sdk

Browser Usage

The SDK is also available as a UMD (Universal Module Definition) build, which can be loaded directly in the browser from popular CDNs:

UNPKG

<script src="https://unpkg.com/@hiero-ledger/[email protected]/dist/umd.js"></script>

When using the UMD build in the browser, the SDK will be available as a global variable sdk. A minified version is also available at dist/umd.min.js.

Build

Prerequisites

  1. Taskfile tool installation
  2. Node.js: It is recommended to use Node.js v20 or higher for best performance and compatibility. The package may also work with Node.js v16, but this version has not been officially tested.
# with npm
$ npm install -g @go-task/cli

# with homebrew
$ brew install go-task
  1. pNpm package manager installation
# with npm
$ npm install -g pnpm

# with homebrew
$ brew install pnpm

After downloading the repo run:

  1. task install

  2. task build to build the SDK

Development

Local Development Workflow

The SDK uses pnpm workspaces to manage its monorepo structure with sub-packages (@hiero-ledger/proto and @hiero-ledger/cryptography). For local development and testing the SDK in other projects, use the following workflow:

Build and Link Globally

Build the SDK and link it globally for use in other local projects:

task build:dev

This command:

  • Builds all packages (proto, cryptography, and the main SDK)
  • Creates global symlinks for all three packages
  • Allows you to use the local SDK in any other project on your machine

Use in Another Project

In your other project, link to the globally linked SDK:

cd /path/to/your/other/project
pnpm link --global @hiero-ledger/sdk

Now any changes you make to the SDK and rebuild will be immediately available in your project.

Unlink and Clean

When you're done with local development:

# In the hiero-sdk-js repository
task clean

This removes all global links and cleans up node_modules.

To unlink in your other project:

# In your other project
pnpm unlink @hiero-ledger/sdk
pnpm install

React Native Support

The Hiero JavaScript SDK provides comprehensive support for React Native environments, including Expo. To ensure seamless integration, follow the guidelines based on your Expo version:

✅ Hiero Javascript SDK Version 2.60 and Above For projects using SDK version 2.60 and above, Expo SDK version 51+ is supported, the SDK requires the react-native-get-random-values package in order to work. To install it, run:

npm install react-native-get-random-values

After installation, the native dependency must be linked for the respective platforms:

🔗 Linking for Native Platforms

  1. iOS: Run the following command to install the native modules:
cd ios && pod install

Then, rebuild the iOS project.

  1. Android: Rebuild the Android project to link the dependency

⚠️ ✅ Hiero Javascript SDK Version 2.59 and Below For projects using SDK version 2.59 and below, Expo SDK Version 49 and below is supported, keep in mind that the SDK uses some functionalities provided from ethers/ethersproject and there is an issue using parts of ethers.js in this environment. A shims package has to be installed and imported before importing the SDK in your project.

npm install @ethersproject/shims

Import it before importing the SDK as shown below:

import '@ethersproject/shims';

import {
    Client,
    PrivateKey
    AccountBalance,
} from "@hiero-ledger/sdk";
...

The Hiero JavaScript SDK does not currently support the following:

  • React Native Bare

Usage

See examples.

Every example can be executed using the following command from the root directory: node examples/[name-of-example].js.

Note: Before running any examples, ensure you have:

  1. Built the SDK by running task build in the root directory.
  2. Installed dependencies by running pnpm install in the examples directory

Configuration

For detailed information on configuring the SDK, including environment variables and client settings, please refer to the CONFIGURATION.md file.

Local Development Setup

For contributors and developers who want to run integration tests locally, we provide Solo - the official Hiero local network solution. Solo provides a production-like Kubernetes-based environment with multiple consensus nodes and mirror node services.

Quick Setup

  1. Install dependencies:

    task install

    Important: This installs Solo and all project dependencies. Must be run before setup.

  2. Set up Solo local network:

    task solo:setup

    This will automatically:

    • Create a local Kubernetes cluster with Kind
    • Deploy a 2-node consensus network (default: v0.69.1)
    • Deploy mirror node services (default: v0.145.2)
    • Create a dedicated ECDSA test account
    • Generate a .env file with all necessary credentials

    Optional: Specify custom versions or use local build:

    # Custom consensus node version
    task solo:setup -- --consensus-node-version v0.70.0
       
    # Custom mirror node version
    task solo:setup -- --mirror-node-version v0.146.0
       
    # Both custom versions
    task solo:setup -- --consensus-node-version v0.70.0 --mirror-node-version v0.146.0
       
    # Use local build (overrides consensus-node-version)
    task solo:setup -- --local-build-path ../hiero-consensus-node/hedera-node/data
  3. (Required for dynamic address book tests) Configure hosts:

    Before running dynamic address book tests, add Kubernetes service names to your /etc/hosts file:

    echo "127.0.0.1 network-node1-svc.solo.svc.cluster.local" | sudo tee -a /etc/hosts
    echo "127.0.0.1 envoy-proxy-node1-svc.solo.svc.cluster.local" | sudo tee -a /etc/hosts
    echo "127.0.0.1 network-node2-svc.solo.svc.cluster.local" | sudo tee -a /etc/hosts
    echo "127.0.0.1 envoy-proxy-node2-svc.solo.svc.cluster.local" | sudo tee -a /etc/hosts

    Note: This is required for dynamic address book tests to pass. Skip if you're only running other integration tests.

  4. Run integration tests:

    task test:integration
  5. Teardown when done:

    task solo:teardown

For detailed setup instructions, troubleshooting, and advanced usage, see the Solo Setup Guide.

Prerequisites

Before setting up Solo, ensure you have:

  • Docker Desktop (or Docker Engine)
  • Kind (Kubernetes in Docker)
  • kubectl
  • Node.js v18+ (comes with npm/npx)

See the Solo Setup Guide for installation instructions.

Running Tests

Unit Tests

Unit tests do not require a local network and can be run directly:

task test:unit

Or separately for Node.js and browser:

task test:unit:node
task test:unit:browser

Integration Tests

Integration tests require a running local network. After setting up Solo (see above):

# Run all integration tests
task test:integration

# Run Node.js integration tests only
task test:integration:node

# Run browser integration tests only
task test:integration:browser

# Run dual-mode tests
task test:integration:dual-mode

Running Dynamic Address Book Tests

Dynamic address book tests require the /etc/hosts configuration described in step 3 of the setup. These tests validate that the SDK can correctly handle node address changes and reconnections using Kubernetes service names.

Note: All integration tests should pass reliably with the Solo setup. If you encounter failures:

  1. Verify Solo is running: task solo:status
  2. For dynamic address book test failures, ensure /etc/hosts is configured (see setup step 3)
  3. Check the troubleshooting section in the Solo Setup Guide
  4. Try a fresh setup: task solo:teardown && task solo:setup

Contributing

Whether you’re fixing bugs, enhancing features, or improving documentation, your contributions are important — let’s build something great together! Please read our contributing guide to see how you can get involved.

Code of Conduct

Hiero uses the Linux Foundation Decentralised Trust Code of Conduct.

License

Apache License 2.0