Skip to main content

Next.js

Official

Authentication for Next.js with full App Router and server-component support.

API reference

Every export is fully typed. The signatures and props below come from the package's own reference documentation, so what is listed here is what the installed version ships.

Functions
function<ThunderIDProvider />

The

ThunderIDProvider is a React Server Component that initializes ThunderID authentication and wraps your application layout. It manages server-side session state and provides authentication context to all child components.

Props
children
ReactNode

**Required.** Your application tree

sessionCookieExpiryTime
number

Session cookie lifetime in seconds. Also configurable via the `THUNDERID_SESSION_COOKIE_EXPIRY_TIME` environment variable

Example
import { ThunderIDProvider } from '@thunderid/nextjs/server'

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>
        <ThunderIDProvider>
          {children}
        </ThunderIDProvider>
      </body>
    </html>
  )
}

Get started

Provider, session, and a protected route, start to finish.

Connect your application

Getting started / Connect your application / Next.js

Open in docs

The quickstart is maintained alongside the rest of the getting-started guides so it stays in step with the platform. This page covers the package itself.

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.