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

@kashscript/identity-sdk

v0.1.3

Published

React SDK for did:kash — WebAuthn (Passkey) bridge, KashAuthProvider, and headless hooks for the Kash Identity Foundry.

Readme

@kashscript/identity-sdk

React + WebAuthn SDK for did:kash. Passkey-backed login, hooks, and opinionated UI components for the Kash Identity Foundry.

bun add @kashscript/identity-sdk @kashscript/identity-core react react-dom

react and react-dom are peer deps — the SDK works with React 18 or 19, in Next.js (App Router or Pages), Remix, Vite, plain CRA, and React Native Web. The headless logic in the root export is UI-free; opt into the Tailwind-styled components via the /ui subpath.


Quickstart — a sign-in flow in 3 components

// 1. Wrap the app once
import { KashAuthProvider } from "@kashscript/identity-sdk/provider";

export default function App({ children }: { children: React.ReactNode }) {
  return <KashAuthProvider>{children}</KashAuthProvider>;
}
// 2. Drop in the connect button (Tailwind required for /ui)
"use client";
import { KashConnect, SignInGate } from "@kashscript/identity-sdk/ui";

export function Header() {
  return <KashConnect variant="outline" compact />;
}

export function Dashboard({ children }: { children: React.ReactNode }) {
  return (
    <SignInGate fallback={<p>Please sign in to continue.</p>}>
      {children}
    </SignInGate>
  );
}
// 3. Use the identity from anywhere with the hook
"use client";
import { useKashAuth } from "@kashscript/identity-sdk/hooks";

export function Greeting() {
  const { identity } = useKashAuth();
  if (!identity) return null;
  return <p>Hello, {identity.handle ?? identity.did}!</p>;
}

That's it. WebAuthn passkey enrollment happens inline, the credential lives in the browser's secure store, and the DID + handle are persisted to localStorage for fast re-auth on next visit.


What's in the box

| Subpath | Purpose | |--------------------------------------|-------------------------------------------------------------| | @kashscript/identity-sdk | Default — re-exports provider, hooks, errors | | @kashscript/identity-sdk/provider | <KashAuthProvider> — React Context boundary | | @kashscript/identity-sdk/hooks | useKashAuth(), useKashIdentity(), useKashSignature() | | @kashscript/identity-sdk/webauthn | Low-level passkey ceremony helpers (register / authenticate)| | @kashscript/identity-sdk/storage | Pluggable storage adapter (default: localStorage) | | @kashscript/identity-sdk/errors | Typed error classes for all failure paths | | @kashscript/identity-sdk/ui | Tailwind-styled <KashConnect>, <SignInGate>, <IdentityWidget>, <SignTransactionModal>, <ShadowFrame> |

The /ui subpath is opt-in. If you don't import from it, no Tailwind classes or React components ship in your bundle — the SDK stays headless and ~12 KB gzipped.


Components

<KashConnect />

A single button that drives the full WebAuthn lifecycle:

  • Idle, no stored identity → "Create identity"
  • Idle, stored identity → "Connect"
  • Authenticating → spinner
  • Authenticated → connected pill with truncated DID + popover (copy DID / disconnect)
  • Error → amber "Try again"

Props:

interface KashConnectProps {
  className?: string;
  style?: React.CSSProperties;
  getHandle?: () => Promise<string | null>;  // override window.prompt
  onConnect?: (identity: KashIdentity) => void;
  onDisconnect?: () => void;
  compact?: boolean;                          // icon-only when connected
  variant?: "solid" | "outline" | "ghost";    // for idle state
}

<SignInGate />

Render-gate any tree behind authentication.

<SignInGate
  fallback={<MarketingLanding />}
  loadingFallback={<Spinner />}
>
  <Dashboard />
</SignInGate>

Pair with <RequireAuth onUnauthorized={() => router.push("/login")}> for imperative redirect-style guards.


SSR / Next.js

Every component under /ui is marked "use client" and respects the hydration boundary. The default loading fallback is a neutral pulse, so your first paint is never a layout-shift surprise.

The provider reads localStorage only inside useEffect, so SSR builds do not throw. If you SSR-render an authenticated tree, the gate shows the fallback until the client hydrates the session — set loadingFallback to control that micro-flicker.


License

Apache-2.0. Also covered by SSLA v1.0 Schedule A (Permissive). See LICENSE.