Docs

createClerkHandler()

The createClerkHandler() function configures Clerk to handle authentication state for TanStack routes, allowing you to easily access user session information within your app.

Usage

Basic usage

The following example demonstrates how to use createClerkHandler() to configure Clerk in your TanStack Start application.

app/ssr.tsx
import { createStartHandler, defaultStreamHandler } from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'
import { createRouter } from './router'
import { createClerkHandler } from '@clerk/tanstack-start/server'

export default createClerkHandler(
  createStartHandler({
    createRouter,
    getRouterManifest,
  }),
)(defaultStreamHandler)

Feedback

What did you think of this content?

Last updated on