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

isa-auth

v0.2.1

Published

Unified, framework-agnostic frontend authentication library supporting OAuth (Google, Apple, Meta, Line, Kakao, Naver), Developer (GitHub, Discord), Web3 (SIWE), Identity (World ID Orb, Passkey WebAuthn), reactive store, and RBAC guards with AI Agent skil

Readme

🚀 ISA AUTH

A Unified, Framework-Agnostic Frontend Authentication Suite
Supporting Multi-Provider OAuth (Google, Apple, Meta, Line, Kakao, Naver), Developer (GitHub, Discord), Web3 (SIWE), Identity (World ID Orb, Passkey WebAuthn), Reactive Store, Axios/Fetch Interceptors, and RBAC/ABAC Guards.

License: MIT TypeScript SWC Bundle Size


🌟 Why ISA AUTH?

Modern web applications frequently require diverse authentication methods — from global platforms (Google, Apple, Meta) and local portals (Kakao, Naver, Line) to developer communities (GitHub, Discord), decentralized Web3 wallets (SIWE), and next-generation biometric/identity systems (World ID Orb & Passkey).

ISA AUTH provides an all-in-one, frontend-centric architecture that is:

  • Framework-Agnostic: Works seamlessly across Vanilla JS, React, Vue, Svelte, or Web Components.
  • Zero Node.js Dependencies: Pure browser-safe cryptographic & JWT utilities with zero Node runtime bloat.
  • Categorized Provider Taxonomy: Organized into social, developer, web3, and identity domains.
  • Next-Gen Identity & Biometrics: Native support for World ID (Orb Proof-of-Personhood) and Passkey (FIDO2 WebAuthn).
  • Enterprise-Ready RBAC/ABAC: Wildcard permission matching (users:*), role hierarchy inheritance, and router navigation guards.
  • HTTP Interceptors (Axios & Fetch): Auto Authorization: Bearer <token> injection and deduplicated 401 refresh queues.
  • Token Exchange Standard: Standardized adapter for exchanging OAuth codes, World ID proofs, and Passkey assertions with backend APIs.
  • Flexible Storage Modes: Multi-tab synchronization, prefix isolation, and HttpOnly Cookie / Hybrid BFF mode.
  • AI Agent Skill Included: Embedded isa-auth-guide skill directly bundled for agent-assisted development.

📦 Installation

npm install isa-auth
# or
yarn add isa-auth
# or
pnpm add isa-auth

🏛️ Architecture & Provider Taxonomy

[UI Layer]           Vanilla DOM / React / Vue / Web Component (<isa-auth-button>)
                          │
[Unified Facade]     IsaAuth (packages/isa-auth)
                          │
           ┌──────────────┼──────────────┬──────────────┐
           ▼              ▼              ▼              ▼
     [Providers]      [Service]       [Store]       [Guards & HTTP]
     ├─ Social        - JwtService    - Memory      - createAuthGuard (RBAC/ABAC)
     │  (Google, Apple,- BaseService   - Local       - Wildcard & Hierarchy
     │   Meta/FB,     - TokenExchange - Session     - Navigation Guard
     │   Kakao, Naver,- AutoRefresh   - Cookie      - onUnauthorized Hook
     │   LINE)        - PKCE Utils    - Tab Sync    - createAuthFetch (Auto 401)
     ├─ Developer                                   - applyAuthInterceptor (Axios)
     │  (GitHub, Discord)
     ├─ Web3
     │  (Ethereum SIWE)
     └─ Identity
        (World ID Orb, Passkey FIDO2)

| Category | Providers | Key Features | | :--- | :--- | :--- | | social | Google, Apple, Meta/Facebook, Kakao, Naver, LINE | Native SDK wrappers, OpenID Connect, OAuth 2.0 PKCE | | developer | GitHub, Discord | Developer OAuth 2.0 PKCE, Bot/Server authorization | | web3 | Ethereum SIWE (EIP-4361) | EIP-1193 wallet detection, personal_sign signature | | identity | World ID (Orb), Passkey (WebAuthn/FIDO2) | ZK-SNARK Proof of Personhood, Face ID / Touch ID / Windows Hello |


🚀 Quick Start Recipes

1. Multi-Provider All-in-One Configuration (Recommended)

Manage multiple social logins, developer platforms, and Web3/Passkey authentication simultaneously in a single application instance:

import { IsaAuth } from 'isa-auth';

// 1. Initialize with multiple providers at once
const auth = new IsaAuth({
  storage: 'memory', // Production security default
  providers: {
    google: { clientId: 'GOOGLE_CLIENT_ID', callbackUrl: 'https://myapp.com/callback' },
    kakao: { clientId: 'KAKAO_JAVASCRIPT_KEY', callbackUrl: 'https://myapp.com/callback' },
    apple: { clientId: 'com.myapp.service', callbackUrl: 'https://myapp.com/callback' },
    github: { clientId: 'GITHUB_CLIENT_ID', callbackUrl: 'https://myapp.com/callback' },
    passkey: { rpName: 'My App', rpId: 'myapp.com' },
  },
});

// 2-A. Trigger a specific provider login programmatically
await auth.signIn('kakao');
// or
await auth.signIn('google');

// 2-B. Render individual provider button
auth.renderButton('github', document.getElementById('github-btn-slot'));

// 2-C. Render all buttons at once with customizable layout (grid / column / row)
auth.renderAllButtons(document.getElementById('social-login-container'), {
  direction: 'grid', // 'grid' | 'column' | 'row'
  gap: '12px',
});

// 3. Inspect registered providers
console.log(auth.getRegisteredProviders()); // ['google', 'kakao', 'apple', 'github', 'passkey']

1-B. Single-Provider Configuration (Legacy & Simple Apps)

import { IsaAuth } from 'isa-auth';

// Initialize with a single provider
const auth = new IsaAuth({
  provider: 'google', // 'google' | 'apple' | 'meta' | 'github' | 'discord' | 'web3' | 'world' | 'passkey'
  clientId: 'YOUR_CLIENT_ID',
  callbackUrl: 'https://myapp.com/auth/callback',
  storage: 'memory',
  storagePrefix: 'myapp',
});

// Render button to a DOM container
auth.renderButton(document.getElementById('login-container'));

// Listen to authentication changes
auth.subscribe((isAuthenticated) => {
  if (isAuthenticated) {
    console.log('User Profile:', auth.getUserInfo());
    console.log('Access Token:', auth.getAccessToken());
  }
});

2. 🌐 World ID (World Network / Orb Verification)

Verify unique humanness using World ID Orb Proof-of-Personhood:

import { IsaAuth } from 'isa-auth';

const worldAuth = new IsaAuth({
  provider: 'world',
  clientId: 'app_staging_your_app_id',
  extraOptions: {
    action: 'vote',
    verificationLevel: 'orb', // 'orb' (Biometric iris scan) or 'device'
    signal: 'user_wallet_address',
    onSuccess: (proof) => {
      console.log('Proof nullifier:', proof.nullifier_hash);
      console.log('ZK-SNARK proof:', proof.proof);
    },
  },
});

await worldAuth.signIn();
const user = await worldAuth.getUserInfo();
console.log(user.isHuman); // true

3. 🔑 Passkey (FIDO2 / WebAuthn Biometrics)

Seamless passwordless authentication via Face ID, Touch ID, or Windows Hello:

import { IsaAuth } from 'isa-auth';

const passkeyAuth = new IsaAuth({
  provider: 'passkey',
  extraOptions: {
    rpName: 'My Enterprise Bank',
    userName: '[email protected]',
  },
});

// Authenticate with device biometrics
await passkeyAuth.signIn();

// Register a new passkey credential
await passkeyAuth.providerInstance.registerCredential();

4. 🔄 HTTP Interceptors (Axios & Fetch) with 401 Auto-Retry

Automatically attaches Authorization: Bearer <token> and queues concurrent requests while refreshing expired tokens:

Axios Interceptor:

import axios from 'axios';
import { IsaAuth } from 'isa-auth';

const auth = new IsaAuth({ provider: 'jwt' });
const apiClient = axios.create({ baseURL: 'https://api.example.com' });

// Applies request/response interceptors to Axios
auth.applyAxiosInterceptor(apiClient, {
  refreshFn: async () => {
    const res = await axios.post('/api/auth/refresh');
    return res.data.accessToken;
  },
  onUnauthorized: () => {
    window.location.href = '/login';
  },
});

// All requests now have automatic Bearer token injection and 401 recovery
const response = await apiClient.get('/users/me');

Fetch Interceptor:

const authFetch = auth.createFetch({
  baseUrl: 'https://api.example.com',
  refreshFn: async () => {
    const res = await fetch('/api/auth/refresh', { method: 'POST' });
    const data = await res.json();
    return data.accessToken;
  },
});

const res = await authFetch('/protected/data');

5. 🛡️ Advanced RBAC/ABAC Guards & Navigation Guards

Supports wildcard permission rules (users:*, *:read, *) and hierarchical role inheritance:

import { IsaAuth } from 'isa-auth';

const auth = new IsaAuth({ provider: 'jwt' });

// Instant wildcard check
auth.can('users:read');       // true if user has 'users:*' or '*'
auth.is('ADMIN');             // role check

// Navigation Guard for React Router / Vue Router
const navGuard = auth.createNavigationGuard({
  requireAuth: true,
  roles: ['ADMIN'],
  roleHierarchy: {
    SUPERUSER: ['ADMIN', 'MANAGER'],
    ADMIN: ['USER'],
  },
  permissions: ['reports:read'],
  redirectToOnUnauthenticated: '/login',
  redirectToOnUnauthorized: '/403',
  onRedirect: (path) => router.push(path),
});

// Use inside router beforeEach hook
const result = await navGuard();
if (!result.allowed) {
  console.warn('Denied reason:', result.reason);
}

6. 🔌 Backend Token Exchange Adapter

Standardized bridge for exchanging OAuth authorization codes, World ID proofs, and Passkey assertions with your backend API:

import { IsaAuth } from 'isa-auth';

const auth = new IsaAuth({ provider: 'github' });
const exchange = auth.createTokenExchange('/api/auth/token-exchange');

// 1. Exchange OAuth code for backend JWT
const tokenRes = await exchange.exchangeOAuthCode('github', 'oauth_code_123');
auth.setAccessToken(tokenRes.accessToken);

// 2. Exchange World ID ZK-Proof for backend session
const worldRes = await exchange.exchangeWorldProof(worldProof);
auth.setAccessToken(worldRes.accessToken);

7. 🛡️ Storage Modes: Security-First Defaults

By default, isa-auth uses 'memory' storage to ensure sensitive tokens are never exposed to XSS attacks via browser localStorage:

// 1. [PRODUCTION DEFAULT] Zero XSS In-Memory Storage
const secureAuth = new IsaAuth({
  provider: 'jwt',
  storage: 'memory', // Default! (No tokens in localStorage)
});

// 2. [PRODUCTION RECOMMENDED] HttpOnly Cookie / BFF Mode
const cookieAuth = new IsaAuth({
  provider: 'base',
  storage: 'cookie', // CookieSessionStorageAdapter (BFF architecture)
});

// 3. [LOCAL DEV ONLY] Insecure LocalStorage for F5 Refresh Convenience
const devAuth = new IsaAuth({
  provider: 'google',
  clientId: 'dev-client-id',
  storage: 'dev_insecure_localStorage', // Explicitly warns in console that this is NOT for production!
});

🤖 Bundled Agent Skill

This package comes pre-packaged with an AI Agent Skill under:

  • skills/isa-auth-guide/SKILL.md
  • .agents/skills/isa-auth-guide/SKILL.md

Supported AI coding agents (Antigravity, Cursor, Windsurf, Claude Code) automatically discover and use this skill for code generation and configuration guidance.


📄 License

This project is licensed under the MIT License.