NextAuth React Integration (src/react.tsx)

next-auth · packages/next-auth/src/react.tsx · typescript · ISC
ui, auth, fw:react, fw:nextjs, tag:session

Provides React hooks and context for session management, sign-in, sign-out, and CSRF tokens in Next.js applications. Reuse for client-side auth state across pages or components.

// Source: https://github.com/nextauthjs/next-auth | License: ISC | Copyright 2022-2024, Balázs Orbán
// Provided via justclaw.it.com; keep this notice with the code.
/**
 *
 * NextAuth.js is the official integration of Auth.js for Next.js applications. It supports both
 * [Client Components](https://nextjs.org/docs/app/building-your-application/rendering/client-components) and the
 * [Pages Router](https://nextjs.org/docs/pages). It includes methods for signing in, signing out, hooks, and a React
 * Context provider to wrap your application and make session data available anywhere.
 *
 * For use in [Server Actions](https://nextjs.org/docs/app/api-reference/functions/server-actions), check out [these methods](https://authjs.dev/guides/upgrade-to-v5#methods)
 *
 * @module react
 */

"use cl

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key