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

@bitakit/better-auth

v0.1.0

Published

Better Auth plugin, organization adapter and server email callbacks for SaaS Foundation.

Downloads

97

Readme

@bitakit/better-auth

Optionales Foundation-Plugin für einen bereits konfigurierten Better-Auth-Client. betterAuthPlugin(client, { signOut? }) liefert ein normales Plugin für die Foundation-Liste. Es stellt den allgemeinen authService bereit: Sitzung, Änderungen und Abmelden.

Die Foundation übernimmt Beobachtung und Cleanup. Der Client und die Serverkonfiguration bleiben beim Host. Die Basis-Anbindung implementiert keine Anmeldeoberfläche; Organisationen und E-Mail-Hooks sind separate optionale Einstiegspunkte desselben Pakets. Es darf nicht als vollständiges Auth-Setup oder Ersatz für serverseitige Rechteprüfungen verstanden werden.

Organisationsanbindung

@bitakit/better-auth/organizations exportiert betterAuthOrganizations(client). Es implementiert den allgemeinen Organisationsvertrag mit den SDK-Methoden des bereits konfigurierten Organization-Clients, einschließlich paginierter Mitgliederlisten. Die UI kommt optional aus @bitakit/organizations/react.

Die aktuelle UI-Berechtigungsprojektion unterstützt die Standardrollen owner/admin/member. Ein deaktiviertes Mitglied wird beim Laden abgewiesen. Eigene Rollen benötigen eine angepasste Fähigkeitenprojektion. Backend-Policies und Suspension-Hooks bleiben Pflicht; der Client-Adapter ist keine Sicherheitsgrenze. Eine bestehende Web-App wird nicht automatisch migriert.

E-Mail (Server)

@bitakit/better-auth/email exportiert betterAuthEmail(emailService, { invitationURL }). Das liefert die Better-Auth-Callbacks sendVerificationEmail, sendResetPassword und sendInvitationEmail. Die ersten beiden gehören in die jeweiligen Auth-Optionen, der dritte in die Organization-Plugin-Konfiguration. Der Host bestimmt seine echte Einladungsroute. Texte sind derzeit deutsche Standardtexte; für andere Templates können Host-Callbacks denselben E-Mail-Service direkt verwenden.

Die Callbacks hängen ausschließlich vom allgemeinen E-Mail-Vertrag ab, nicht von Nodemailer. Sie werden nicht automatisch in eine bereits erzeugte Server-Auth-Instanz injiziert.

Organisationsverwaltung

betterAuthOrganizations(client) unterstützt native Erstellung mit anschließendem Aktivieren, Profiländerung, Logo, Website-Metadata und Löschen. Die vorhandenen serverseitigen Better-Auth-Regeln gelten weiterhin. Optional können explizite Server-Erweiterungen diese Operationen übernehmen. sessionOrganizationBackend(client, authenticated, signedOut) trennt einen ausdrücklich lokalen Demo-Einstieg von echten Konten; Fehler des echten Backends werden nie mit Demo-Daten beantwortet. Host-Apps komponieren nur die Adapter, die Logik bleibt im Paket. Ohne Einladungserweiterung gilt die serverseitige Standardlaufzeit; Mitgliedssperren benötigen eine explizite Erweiterung.

Standard browser client

createBetterAuthClient from @bitakit/better-auth/client creates the shared browser client with organization/teams, multi-session, API key, and two-factor extensions. These are client capabilities, not server activation: the server must configure the matching native extensions. Native client options such as baseURL are supported; plugins supplied to this helper append additional client extensions. Use the native createAuthClient and existing betterAuthPlugin directly for a different preset.

The main headless adapter entry remains separate from this browser-only subpath.

Shared client navigation

Pass application-owned paths: { signIn, afterSignIn, afterSignOut } as the second argument to betterAuthPlugin. An optional signIn(options) delegates a native login flow; without it, useAuth().signIn() opens the configured application login page. The existing signOut override remains supported. Use the shared UI hook for configured post-logout navigation; avoid also redirecting inside the override.

See the client authentication guide for configuration, AuthBoundary, safe return destinations and a provider adapter template. These additions are workspace APIs pending release. Native server configuration and login UI remain external.