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

@erikey/react

v0.6.0

Published

React SDK for Erikey - B2B authentication and user management. UI components based on better-auth-ui.

Readme

@auth-ai/sdk

React SDK for Auth.ai - Easy authentication integration for your React applications.

Installation

npm install @auth-ai/sdk
# or
pnpm add @auth-ai/sdk
# or
yarn add @auth-ai/sdk

Quick Start

1. Wrap your app with AuthProvider

import { AuthProvider } from '@auth-ai/sdk';

function App() {
  return (
    <AuthProvider config={{ baseURL: 'https://api.yourapp.com' }}>
      <YourApp />
    </AuthProvider>
  );
}

2. Use authentication hooks

import { useAuth, ProtectedRoute } from '@auth-ai/sdk';

function Dashboard() {
  const { user, signOut } = useAuth();

  return (
    <ProtectedRoute>
      <div>
        <h1>Welcome, {user?.email}!</h1>
        <button onClick={signOut}>Sign Out</button>
      </div>
    </ProtectedRoute>
  );
}

API Reference

AuthProvider

Wrap your application with this provider to enable authentication.

<AuthProvider
  config={{
    baseURL: 'https://api.yourapp.com',
    credentials: 'include', // optional
  }}
>
  {children}
</AuthProvider>

useAuth()

Access authentication state and methods.

const {
  user,              // Current user object
  session,           // Current session
  isLoading,         // Loading state
  isAuthenticated,   // Boolean auth status
  signIn,            // Sign in function
  signUp,            // Sign up function
  signOut,           // Sign out function
  refreshSession,    // Manually refresh session
} = useAuth();

useUser()

Get current user data.

const user = useUser();

if (user) {
  console.log(user.email, user.role);
}

useOrganization()

Access organization data and methods.

const {
  organization,        // Current active organization
  organizations,       // List of user's organizations
  switchOrganization,  // Switch to different org
  isLoading,
} = useOrganization();

ProtectedRoute

Protect routes that require authentication.

<ProtectedRoute
  fallback={<LoginPage />}     // Optional: custom fallback
  redirectTo="/login"           // Optional: redirect URL
>
  <PrivatePage />
</ProtectedRoute>

Examples

Login Form

import { useAuth } from '@auth-ai/sdk';
import { useState } from 'react';

function LoginForm() {
  const { signIn } = useAuth();
  const [email, setEmail] = useState('');
  const [password, setPassword] = useState('');

  const handleSubmit = async (e) => {
    e.preventDefault();
    try {
      await signIn(email, password);
    } catch (error) {
      console.error('Login failed:', error);
    }
  };

  return (
    <form onSubmit={handleSubmit}>
      <input
        type="email"
        value={email}
        onChange={(e) => setEmail(e.target.value)}
        placeholder="Email"
      />
      <input
        type="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
        placeholder="Password"
      />
      <button type="submit">Sign In</button>
    </form>
  );
}

User Profile

import { useUser } from '@auth-ai/sdk';

function UserProfile() {
  const user = useUser();

  if (!user) {
    return <div>Not logged in</div>;
  }

  return (
    <div>
      <h1>{user.name || user.email}</h1>
      <p>Role: {user.role}</p>
      <p>Joined: {new Date(user.createdAt).toLocaleDateString()}</p>
    </div>
  );
}

License

MIT