@auth/core

v0.34.3 ISC

Authentication for the Web.

Weekly Downloads
2.0M
Stars
28.2K
Forks
4.0K
Open Issues
573
Gzip Size
44.3 kB
Unpacked Size
1.6 MB
Last Updated
15d ago

@auth/core Download Trends

Download trends for @auth/core02.6M5.2M7.7M10.3MApr 2025JulOctJanApr 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.

@auth/core Alternatives

@auth/core Categories