The AuthKit TanStack Start SDK provides utilities for integrating AuthKit authentication into TanStack Start applications.
Refer to the AuthKit documentation for detailed usage instructions and examples.
-beta.* suffix, for example, 3.2.0-beta.1. For more information on how to use the beta versions, refer to the README in the GitHub repository.Full Changelog: v0.4.1...v0.5.0
Full Changelog: v0.3.1...v0.4.1
Full Changelog: v0.2.0...v0.3.0
Release Date: October 6, 2025
This is the initial release of @workos/authkit-tanstack-react-start, bringing WorkOS AuthKit authentication to TanStack Start applications.
This release provides a complete authentication solution for TanStack Start, built on top of the battle-tested @workos/authkit-session library. It includes both server-side and client-side APIs designed specifically for TanStack Start's architecture.
Authentication Functions
getAuth() - Get the current authenticated user in loaders and server functionsgetSignInUrl() / getSignUpUrl() - Generate AuthKit URLs with automatic state managementgetAuthorizationUrl() - Full control over OAuth parameters (screen hints, organization, etc.)signOut() - Sign out the current user and revoke their sessionswitchToOrganization() - Switch user context to a different organizationRoute Handlers
handleCallbackRoute - Complete OAuth callback handler for /api/auth/callbackauthkitMiddleware() - Request middleware for session managementReact Hooks
useAuth() - Access user info and loading state in client componentsuseAccessToken() - Get the current access token with automatic refreshuseTokenClaims() - Access JWT claims from the current sessionComponents
AuthKitProvider - Context provider for client-side hooks (only needed if using client hooks)iron-session encryptionThis SDK is designed with TanStack Start's architecture in mind:
createServerFn)This library is designed for TanStack Start v1.0+. TanStack Start is currently in RC/beta, so expect some API changes as the framework stabilizes. We've designed the SDK to be flexible enough to adapt to framework changes.
Server functions created with createServerFn can ONLY be called from:
loader functions ✅NOT from:
beforeLoad functions ❌ (runs on both server and client)See the README for detailed execution context information.
The SDK follows TanStack Start's bundler conventions:
src/server/src/client/Complete documentation is available in the README.md, including:
This SDK is inspired by and follows patterns from:
@workos-inc/authkit-nextjs - The reference implementation for Next.js@workos/authkit-session - The core session management libraryInstall now:
npm install @workos/authkit-tanstack-react-start
pnpm add @workos/authkit-tanstack-react-start
Get started in 3 steps - see the README for the quickstart guide.