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

@kaappu/react

v0.2.2

Published

Kaappu Identity — React components for authentication, authorization, and AI-aware access control. Drop-in <LoginPanel />, <RegisterPanel />, <Authorize />, and useKaappu() hook.

Readme

@kaappu/react

Drop-in React components for Kaappu Identity — authentication, authorization, and AI-aware access control.

npm version license

What's in the box

  • <KaappuProvider /> — wraps your app, manages session state, handles silent token refresh
  • <LoginPanel /> — full sign-in UI: OAuth (Google / GitHub / Microsoft / Apple), passkey, email + password, magic link, OTP, phone
  • <RegisterPanel /> — full sign-up UI: OAuth providers, password rules, confirm password, friendly error messages, optional email verification
  • <Authorize /> — conditionally render based on permission or role
  • <LoggedIn /> / <LoggedOut /> — conditional render based on session state
  • <ProfileBadge /> — user avatar with sign-out menu
  • <AccountView /> — drop-in account settings page
  • useKaappu() — hook returning { isLoaded, isSignedIn, user, hasPermission, signOut, getToken, ... }

All components are theme-aware, accessible, and work with both light and dark color schemes out of the box.

Install

npm install @kaappu/react
# or
pnpm add @kaappu/react
# or
yarn add @kaappu/react

Peer dependencies: react >= 18, react-dom >= 18.

Quick start

import { KaappuProvider, LoginPanel, LoggedIn, LoggedOut, useKaappu } from '@kaappu/react'

// 1. Wrap your app
function App() {
  return (
    <KaappuProvider
      publishableKey="pk_live_..."
      baseUrl="https://id.your-domain.com/igai"
    >
      <YourApp />
    </KaappuProvider>
  )
}

// 2. Use the components anywhere
function Header() {
  const { user, signOut } = useKaappu()
  return (
    <header>
      <LoggedOut>
        <a href="/sign-in">Sign in</a>
      </LoggedOut>
      <LoggedIn>
        <span>Hi, {user?.email}</span>
        <button onClick={signOut}>Sign out</button>
      </LoggedIn>
    </header>
  )
}

// 3. Drop the auth panels onto a page
function SignInPage() {
  return <LoginPanel onSuccess={(token, user) => window.location.href = '/'} />
}

Authorization

import { Authorize } from '@kaappu/react'

// Permission-gated content
<Authorize
  permission="billing:manage"
  fallback={<p>Upgrade to access billing.</p>}
>
  <BillingPanel />
</Authorize>

// Role-gated content
<Authorize role="admin">
  <AdminTools />
</Authorize>

// Wildcard permission "*" grants access to everything (built-in admin shortcut)

Standalone mode (no provider)

If you don't want to wrap your app in <KaappuProvider>, you can use <LoginPanel /> and <RegisterPanel /> as standalone components:

<LoginPanel
  authUrl="https://id.your-domain.com/api/auth"
  accountId="your-tenant-id"
  onSuccess={(token, user) => { /* persist token, redirect */ }}
/>

Theming

Pass an appearance prop to any component to override colors and typography:

import { LoginPanel, createTheme } from '@kaappu/react'

const theme = createTheme({
  colorScheme: 'light',
  variables: {
    primaryColor: '#0ea5e9',
    borderRadius: '0.5rem',
    fontFamily: 'Inter, system-ui, sans-serif',
  },
})

<LoginPanel appearance={theme} />

Themes use CSS custom properties under the hood (--k-primary, --k-card-bg, --k-text, etc.) so you can also override them directly with stylesheets.

What this SDK is for

@kaappu/react is the React client for the Kaappu Identity platform — a closed-loop security control plane for AI-era applications. The SDK lets you drop production-grade authentication, authorization, and identity management into a React app in minutes, with the same primitives Kaappu uses on its own website (kaappu.org).

Learn more at kaappu.org — including the Security Control Loop white paper and customer case studies.

License

MIT © Kaappu