Registry / auth-security / next-auth-client

next-auth-client

JSON →
library1.5.0jsnpmunverified

The `next-auth-client` package served as a client-side library for the `next-auth` authentication module, primarily intended for use with `next-auth` versions prior to 1.5.0. Its purpose was to provide utility functions and client-side integration points for managing user sessions and authentication flows within applications leveraging the `next-auth` backend. The current stable version of this specific client library is 1.5.0. However, as of `next-auth` version 1.5.0, the core functionality of `next-auth-client` was absorbed directly into the main `next-auth` package itself, rendering this standalone client library redundant and unmaintained. Consequently, it has no active release cadence and developers are strongly advised against using it for any new or existing projects, and should instead opt for the client utilities bundled directly with `next-auth` (i.e., `import { NextAuth } from 'next-auth/client'`). Its key differentiator was being a separate, lightweight client, but this distinction no longer exists.

npm install next-auth-client
INSTALL
IMPORT
SIG · NEXT-AUTH-CLIENT
N
next-auth-client
auth-securityjavascriptv1.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NextAuth
import { NextAuth } from 'next-auth-client'
const NextAuth = require('next-auth-client')
This package is deprecated. Its functionality moved to 'next-auth/client' as of next-auth@1.5.0. Do not use for new projects; this import pattern is for historical reference only.

Demonstrates the historical client-side usage of the `NextAuth` object from this deprecated package to retrieve session information.

// WARNING: This package is deprecated and should not be used in new projects. // Its functionality has been integrated directly into the 'next-auth' package. // // This quickstart demonstrates the *historical* usage of the next-auth-client package. // // In an older client-side application context (e.g., a React component): import { NextAuth } from 'next-auth-client'; async function checkAuthenticationStatus() { try { // Attempt to get the session from the next-auth backend via this client. // In a real application, this would typically be called on page load // or when authentication status needs to be verified. const session = await NextAuth.getSession(); if (session) { console.log('User is authenticated.'); console.log('Session details:', session); if (session.user && session.user.email) { console.log(`Welcome back, ${session.user.email}!`); } } else { console.log('User is not authenticated.'); // Example: Redirect to login page in a real app // NextAuth.redirect({ url: '/api/auth/signin' }); } } catch (error) { console.error('Error checking authentication status:', error); } } // Simulate calling this function, e.g., on initial application load or component mount checkAuthenticationStatus(); // Other typical client-side actions (for historical context): // NextAuth.signin('github'); // Initiates OAuth sign-in // NextAuth.signout(); // Initiates sign-out // const csrfToken = await NextAuth.getCsrfToken(); // Fetches CSRF token for forms
Debug
Known issues
breakingThe `next-auth-client` package is deprecated and no longer maintained. Its functionality has been merged directly into the main `next-auth` package itself, starting from `next-auth@1.5.0`. Using this package will lead to outdated or broken authentication flows and potential security vulnerabilities.
fix
Migrate your application to use the client utilities bundled with `next-auth`. Specifically, replace `import { NextAuth } from 'next-auth-client'` with `import { NextAuth } from 'next-auth/client'` and remove `next-auth-client` from your project's dependencies.
affects: >=1.5.0
gotchaContinuing to use `next-auth-client` after `next-auth@1.5.0` will result in code that is incompatible with newer `next-auth` server-side implementations and will not receive any updates, bug fixes, or security patches.
fix
Immediately cease using this package. Ensure your `next-auth` dependency is up-to-date and leverage its built-in client-side exports for authentication management.
affects: >=1.5.0
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
next-auth-client — npm install next-auth-client · libregistry