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

@avokjs/react

v0.2.0

Published

React facade for Avok: AvokProvider + hooks (web).

Readme

@avokjs/react

React bindings for Avok. The passkey is the wallet: K = HKDF(PRF(credential)), derived inside the origin-point Vault on every gesture and stored nowhere.

npm i @avokjs/react react

Peer dependency: react >=19.2.7.

Quickstart

import { AvokProvider, createAvok, useAccount, useLogin } from "@avokjs/react";

const client = await createAvok({
  originPoint: "https://vault.example.com", // yours, or someone else's (permissionless)
  chains: ["base"],
  wallet: { name: "Example Wallet", rdns: "com.example.wallet" }, // shown in wallet pickers
});

function Wallet() {
  const { account } = useAccount();
  const { login, pending, error } = useLogin();
  if (!account) {
    return (
      <button disabled={pending} onClick={() => login()}>
        Connect
      </button>
    );
  }
  return <p>{account.evm.address}{error && <span>{error.message}</span>}</p>;
}

export default function App() {
  return (
    <AvokProvider client={client}>
      <Wallet />
    </AvokProvider>
  );
}

There is no passkey domain or auth-server URL to set on the SDK side. Every app configures a single originPoint, the URL of the operator's Vault page, and the SDK opens a popup there for every wallet action.

Hooks

Each mutation hook returns pending and error next to its action, so a failed passkey gesture or a rejected signature surfaces where you render it.

| Hook | What it does | | --- | --- | | useAvok | Returns the client. | | useAccount | Reactive { account, status } snapshot. | | useLogin | Open the origin-point popup and connect. | | useLogout | End the session. | | useAvokConnect | The WalletConnect-style connect trigger: { connect, isPending, isConnected, account, error }. | | useDevices | Read the device roster; build (not send) register/revoke calls. | | useGuardians | Read the guardian set and any pending recovery; build (not send) setup/propose/execute/veto calls. |

Components: AvokProvider, AuthPopup (mount the Vault ceremony as a React tree instead of the plain-DOM entry, for an operator building their own Vault page in React), SharedOrigin (the async wiring for a popup-backed connection). Exact return shapes are in the hooks' own TSDoc.

Sending and signing are not hooks

createAvok announces an EIP-1193 provider over EIP-6963. You send and sign with the stock ecosystem tools, wagmi, viem, ethers or RainbowKit, which discover Avok like any other wallet. client.getEip1193Provider() returns the provider directly if you are not using a connector library.

useDevices/useGuardians follow the same rule: they build a { to, value, data } self-call. Device registration and guardian-set changes are ordinary wallet transactions, and you send it through the provider, exactly like any other action. Neither hook signs or submits anything itself.

Devices and guardians

Enrolling a new device (@avokjs/core/wallet's createDeviceEnrollmentRequest, run on the NEW device) and registering it on chain (useDevices().buildRegisterCall, sent from an EXISTING device) are two separate steps a UI composes; there is no bundled pairing ceremony in this package. A guardian's own approval of a recovery is a different action again (their key, not the wallet's), and runs on the origin-point's own recovery screen, not through this SDK. useGuardians is for the wallet OWNER managing who their guardians are, not for a guardian to act.

Documentation

This package is a thin React layer over @avokjs/core. See that package's README for the underlying config, subpaths, and the sponsorship contract.