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

@hieco/react

v1.0.0

Published

React hooks for @hieco/sdk with TanStack Query

Downloads

51

Readme

@hieco/react

@hieco/react brings the Hieco SDK into React with providers, TanStack Query integration, and hooks that feel native in modern app code.

If @hieco/sdk is the engine room, @hieco/react is the layer that lets your component tree use it with less ceremony and better caching.

Why This Package Exists

React apps need more than direct SDK calls. They need:

  • a shared client lifecycle
  • a clear place to provide a signer
  • query keys and invalidation that match the data model
  • hooks that fit loading, error, and success states cleanly

@hieco/react wraps @hieco/sdk in that experience.

When To Use It

Choose @hieco/react when you are building:

  • React apps that read Hedera data
  • React apps that submit transactions
  • wallet-connected UIs that pass a signer into a shared client
  • server-rendered or hydrated React apps that already use TanStack Query

If you only need a non-React client, use @hieco/sdk.

Installation

npm install @hieco/react @hieco/sdk @tanstack/react-query
pnpm add @hieco/react @hieco/sdk @tanstack/react-query
yarn add @hieco/react @hieco/sdk @tanstack/react-query
bun add @hieco/react @hieco/sdk @tanstack/react-query

Peer dependencies expected from the host app:

  • react >= 18
  • react-dom >= 18

Quick Start

import { HiecoProvider, useAccountInfo } from "@hieco/react";

function AccountCard() {
  const account = useAccountInfo({ accountId: "0.0.1001" });

  if (account.isPending) return <div>Loading...</div>;
  if (account.isError) return <div>{account.error.message}</div>;

  return <pre>{JSON.stringify(account.data, null, 2)}</pre>;
}

export function App() {
  return (
    <HiecoProvider config={{ network: "testnet" }}>
      <AccountCard />
    </HiecoProvider>
  );
}

The Usual Flow

Most apps follow this pattern:

  1. Mount HiecoProvider.
  2. Pass public client config with config.
  3. Pass a signer when the app becomes wallet-connected.
  4. Use Hieco hooks in components.

The provider can create its own QueryClient when needed, or reuse one from the host app.

Runtime Boundaries

The package is deliberately strict about runtime boundaries:

  • config only accepts public client configuration
  • operator credentials stay in server-only @hieco/sdk code
  • signer is passed separately as session state

That split keeps React code focused on client state and queries instead of lower-level SDK configuration.

Common Workflows

Use a wallet signer

import { HiecoProvider } from "@hieco/react";
import { WalletProvider, useWallet } from "@hieco/wallet-react";

function HiecoRuntime({ children }: { children: React.ReactNode }) {
  const wallet = useWallet();

  return (
    <HiecoProvider config={{ network: "testnet" }} signer={wallet.session?.signer}>
      {children}
    </HiecoProvider>
  );
}

Reuse your own QueryClient

import { QueryClient } from "@tanstack/react-query";
import { HiecoProvider } from "@hieco/react";

const queryClient = new QueryClient();

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <HiecoProvider config={{ network: "testnet" }} queryClient={queryClient}>
      {children}
    </HiecoProvider>
  );
}

API At A Glance

Core exports:

  • HiecoProvider
  • generated query and mutation hooks
  • createHiecoQueryKey
  • createHiecoMutationKey

The package also re-exports the @hieco/sdk surface so shared types and helpers stay close at hand in React code.

There is also an optional AppKit subpath:

  • @hieco/react/appkit

Use that only when you specifically need the AppKit bridge.

Packaging And Runtime Support

@hieco/react publishes:

  • browser-friendly ESM output
  • externalized dependencies in the published build
  • explicit conditional exports for browser, worker, workerd, node, and default

That keeps the package easier to consume in modern React stacks without changing how the public API feels in app code.

Related Packages