PACKAGE · AUTHENTICATION

@auth/core

Authentication for the Web.

WEEKLY DOWNLOADS 1.8M
STARS 28.3K
FORKS 4.0K
OPEN ISSUES 586
GZIP SIZE 44.3 kB
UNPACKED SIZE 1.6 MB
LAST UPDATED 2mo ago
DOWNLOAD TRENDS

@auth/core downloads — last 12 months

Download trends for @auth/core1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.03.3M6.6M9.9M13.2MJun 2025SepDecMarMay 2026
@auth/core
ABOUT @AUTH/CORE

@auth/core provides a flexible and comprehensive solution for adding authentication to modern web applications. It aims to abstract away the complexities of various authentication providers and security concerns, allowing developers to focus on building features. The package addresses the common need for secure and standardized ways to handle user sign-in, sign-up, and session management across different platforms and frameworks.

Designed with developer experience and security as primary goals, @auth/core targets frontend, backend, and full-stack developers building applications with JavaScript and TypeScript. Its philosophy centers on modularity and adaptability, enabling easy integration without imposing a rigid architecture. This makes it suitable for projects ranging from single-page applications to complex server-rendered setups, offering a unified approach to managing user identities.

The core of @auth/core revolves around a hook-based and adapter-based API. Key patterns include stateless JWT verification, session management strategies, and universal data fetching capabilities. Developers interact with mechanisms like `signIn`, `signOut`, and `getSession` to manage user states and authentication flows. The package also supports various authentication strategies, including OAuth, email/password, and magic links, through configurable providers.

Integration is a strong suit for @auth/core, offering seamless compatibility with popular JavaScript frameworks such as React, Vue, SvelteKit, and SolidJS. It also provides utilities for use in Node.js backend environments and integrates well with meta-frameworks like Next.js and Nuxt. This broad ecosystem support means developers can adopt @auth/core regardless of their preferred frontend or backend stack, ensuring consistency across their application.

With a bundle size of 44.3 kB (gzipped), @auth/core strikes a balance between feature richness and performance. While not the absolute smallest authentication solution available, its size is manageable for most modern web applications. The project indicates a mature development cycle with regular updates, as evidenced by its recent activity, though developers should note the target last updated date in the provided information.

One potential consideration is the package's extensibility, which, while a strength, might introduce complexity for developers needing only the most basic authentication features. For extremely simple use cases requiring only local storage state, lighter alternatives might exist. However, for multi-provider, secure, and scalable authentication, @auth/core offers a robust foundation.

WHEN TO USE
  • When implementing OAuth 2.0 or OpenID Connect flows with providers like Google, GitHub, or Auth0.
  • When managing JWTs and session cookies securely across serverless and traditional Node.js backends.
  • When building full-stack applications with frameworks like Next.js or Nuxt.js that benefit from integrated authentication.
  • When requiring flexible authentication strategies including email/password, magic links, or passwordless authentication.
  • When needing to synchronize authentication state across server-rendered components and client-side applications.
  • When leveraging React Server Components for seamless user data fetching post-authentication.
  • When building API routes that require robust authentication middleware and authorization checks.
WHEN NOT TO USE
  • If your application only requires managing simple, client-side state without server verification — browser-native `localStorage` or `sessionStorage` might suffice.
  • For embedded applications where authentication is entirely managed by an external single-sign-on service without direct integration needs.
  • If you are building a purely static site with no dynamic user data or login requirements.
  • When a lighter, opinionated authentication solution tailored to a very specific framework is preferred and @auth/core's generality is not needed.
  • If your authentication flows are entirely based on immutable server-side rendered sessions without the need for client-side state synchronization.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 7
@auth/core vs @clerk/nextjs ★ 1.7K · 785.1K/wk @auth/core vs lucia ★ 10.5K · 106.1K/wk @auth/core vs next-auth ★ 28.3K · 2.4M/wk @auth/core vs jose ★ 7.6K · 40.1M/wk @auth/core vs @auth0/nextjs-auth0 ★ 2.3K · 281.4K/wk @auth/core vs @supabase/supabase-js ★ 4.5K · 10.8M/wk @auth/core vs jwt-decode ★ 3.4K · 7.6M/wk