Skip to main content

TanStack Router

Official

Type-safe authentication for TanStack Router applications.

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<CallbackRoute />

The

CallbackRoute component handles the OAuth 2.0 authorization code callback. Mount it at your application's redirect URI path. It processes the authorization code, validates the CSRF state parameter, exchanges the code for tokens, and navigates the user back to their original destination. :::note CallbackRoute must be rendered inside a ThunderIDProvider and a TanStack Router context. :::

Props
onErroroptional
(error: Error) => void

Called when callback processing fails (e.g., invalid state, token exchange error)

onNavigateoptional
(path: string) => void

Override the default post-callback navigation. Receives the resolved destination path. Defaults to TanStack Router's `router.navigate()`

Example
import { createRoute } from '@tanstack/react-router'
import { CallbackRoute } from '@thunderid/tanstack-router'

const callbackRoute = createRoute({
  getParentRoute: () => rootRoute,
  path: '/callback',
  component: CallbackRoute,
})
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.