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

@authon/js

v0.1.16

Published

Authon core browser SDK — ShadowDOM login modal, OAuth, session management

Readme

@authon/js

Core browser SDK for Authon — ShadowDOM login modal, OAuth flows, and session management.

Install

npm install @authon/js
# or
pnpm add @authon/js

Quick Start

import { Authon } from '@authon/js';

const authon = new Authon('pk_live_...');

// Open the sign-in modal
await authon.openSignIn();

// Listen for auth events
authon.on('signedIn', (user) => {
  console.log('Signed in:', user.email);
});

authon.on('signedOut', () => {
  console.log('Signed out');
});

// Email/password sign-in
const user = await authon.signInWithEmail('[email protected]', 'password');

// OAuth sign-in (opens popup)
await authon.signInWithOAuth('google');

// Get current user and token
const currentUser = authon.getUser();
const token = authon.getToken();

// Sign out
await authon.signOut();

Configuration

const authon = new Authon('pk_live_...', {
  apiUrl: 'https://api.authon.dev',  // Custom API URL
  mode: 'popup',                      // 'popup' | 'embedded'
  theme: 'auto',                      // 'light' | 'dark' | 'auto'
  locale: 'en',                       // Locale for the modal UI
  containerId: 'auth-container',      // Container element ID (embedded mode)
  appearance: {                        // Custom branding overrides
    primaryColorStart: '#7c3aed',
    primaryColorEnd: '#4f46e5',
    borderRadius: 12,
    brandName: 'My App',
  },
});

API Reference

Authon class

| Method | Returns | Description | |--------|---------|-------------| | openSignIn() | Promise<void> | Open the sign-in modal | | openSignUp() | Promise<void> | Open the sign-up modal | | signInWithEmail(email, password) | Promise<AuthonUser> | Sign in with email/password | | signUpWithEmail(email, password, meta?) | Promise<AuthonUser> | Register with email/password | | signInWithOAuth(provider) | Promise<void> | Start OAuth flow in popup window | | signOut() | Promise<void> | Sign out and clear session | | getUser() | AuthonUser \| null | Get current user | | getToken() | string \| null | Get current access token | | on(event, listener) | () => void | Subscribe to events (returns unsubscribe fn) | | destroy() | void | Clean up resources |

Events

| Event | Payload | Description | |-------|---------|-------------| | signedIn | AuthonUser | User signed in | | signedOut | none | User signed out | | tokenRefreshed | string | Access token was refreshed | | error | Error | An error occurred |

ShadowDOM Modal

The login modal renders inside a ShadowRoot, preventing CSS conflicts with your application. Branding (colors, logo, border radius, custom CSS) is fetched from your Authon project settings and can be overridden via the appearance config.

Documentation

authon.dev/docs

License

MIT