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

@torii-js/torii-react

v0.10.1

Published

React authentication components for Torii: zero-config, self-contained styles

Readme

@torii-js/torii-react

Zero-config React authentication for Torii. Drop-in, self-contained UI — no CSS imports, no Tailwind setup, no peer dependencies beyond React.

📚 Full documentation: docs.toriiauth.eu

Installation

npm install @torii-js/torii-react
# or: pnpm add / yarn add

That's it — no CSS import, no theme provider, no build config. Styles are injected automatically at runtime and scoped under a .torii wrapper so they never leak into your app.

Quick start

Wrap your app in <ToriiProvider> with your publishable key (from the dashboard → Settings → API keys). The provider owns session state, refreshes tokens in the background, and exposes useAuth() to the tree.

import { ToriiProvider } from '@torii-js/torii-react';
import { createRoot } from 'react-dom/client';
import App from './App';

createRoot(document.getElementById('root')!).render(
  <ToriiProvider publishableKey={import.meta.env.VITE_TORII_PUBLISHABLE_KEY}>
    <App />
  </ToriiProvider>,
);

Render UI per auth phase with the control components — <AuthLoading> while the session probe runs, <SignedOut> when there's no session, <SignedIn> when authenticated:

import { AuthLoading, SignedIn, SignedOut, SignIn, UserDashboard } from '@torii-js/torii-react';

export default function App() {
  return (
    <>
      <AuthLoading><p>Loading…</p></AuthLoading>
      <SignedOut><SignIn /></SignedOut>
      <SignedIn><UserDashboard /></SignedIn>
    </>
  );
}

<SignIn> is the prebuilt sign-in/up card; <UserDashboard> is the full account surface (avatar menu, profile, connected accounts, active sessions, data-export requests). See the quickstart for the end-to-end walkthrough.

What's included

  • Drop-in components<SignIn>, <SignUp>, <UserButton>, <UserDashboard>, <UserProfile>, <OrganizationSwitcher>, <OrganizationList>, and more.
  • Control components<SignedIn>, <SignedOut>, <AuthLoading>, <Show> (role/permission gating), <RedirectToSignIn>.
  • HooksuseAuth(), useUser(), useAuthFetch() for the common path, plus headless hooks (useSignIn, useSignUp, useSessions, useOrganizations, useMfaEnrollment, …) for building your own UI.

Full prop and hook reference: docs.toriiauth.eu.

Theming

Customize everything through the provider's appearance prop — pick a preset, override design tokens, or attach classes/styles to individual elements:

<ToriiProvider
  publishableKey={pk}
  appearance={{
    theme: 'shadcn', // or 'mui', or a full Theme object
    variables: { primary: '243 75% 59%', radius: '0.5rem' }, // colors are HSL triplets
    elements: { formButtonPrimary: 'rounded-full' },
  }}
>

The SDK emits both light and dark token sets, so a .dark class on your <html> recolors it automatically. See theming.

Internationalization

Ships with English (default) and Danish, with browser-locale auto-detection. Override any label per component or globally; see labels.

Before production

The session refresh uses a cross-site cookie that Safari blocks for many users, silently signing them out. Wire up a first-party cookie setup (proxy or CNAME) before you ship — it's a required step, not an optimization.

License

MIT