Releases: workos/authkit-tanstack-start
v0.5.0
v0.4.1
What's Changed
- Add context7.json to repo by @nicknisi in #35
- fix types in tests by @nicknisi in #34
- feat: use npm Trusted Publishers for releases by @nicknisi in #37
- feat: pass all options through getSignInUrl and getSignUpUrl by @nicknisi in #36
- fix: use Node 24 for npm 11+ (required by Trusted Publishers) by @nicknisi in #39
Full Changelog: v0.3.1...v0.4.1
v0.3.1
v0.3.0
What's Changed
- change node version in release version by @nicknisi in #15
- fix: correct handleCallbackRoute usage in README examples by @nicknisi in #16
- fix: improve URL validation in signOut redirect logic by @rgcottrell in #21
- Fix client bundling and upgrade authkit-session to 0.3.0 by @nicknisi in #26
- Export authkit instance for middleware configuration by @juliusmarminge in #14
- feat: allow passing initial state to provider by @juliusmarminge in #17
- Update package dependencies by @nicknisi in #28
- fix: remove unused ensureSignedIn parameter from server actions by @nicknisi in #27
- Release v0.3.0 by @nicknisi in #30
New Contributors
- @rgcottrell made their first contribution in #21
- @juliusmarminge made their first contribution in #14
Full Changelog: v0.2.0...v0.3.0
v0.2.0
What's Changed
- chore: remove dotenv from example vite.config by @nicknisi in #10
- feat: add onSuccess and onError hooks to callback route by @nicknisi in #9
- Fix signOut to delete the configured session cookie name by @nicknisi in #8
- Package updates and type fixes by @nicknisi in #12
Full Changelog: v0.1.0...v0.2.0
v0.1.0
Release Notes: v0.1.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.
🎉 What's New
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.
Server-Side Features
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 organization
Route Handlers
handleCallbackRoute- Complete OAuth callback handler for/api/auth/callbackauthkitMiddleware()- Request middleware for session management
Client-Side Features
React 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 session
Components
AuthKitProvider- Context provider for client-side hooks (only needed if using client hooks)
Session Management
- Cookie-based sessions using
iron-sessionencryption - Automatic token refresh when tokens are expiring
- JWKS-based token verification
- Support for impersonation workflows
- Organization switching
- Configurable cookie settings (domain, maxAge, sameSite, etc.)
🎯 Design Philosophy
This SDK is designed with TanStack Start's architecture in mind:
- Server-First: Primary API uses TanStack Start server functions (
createServerFn) - Type-Safe: Full TypeScript support with comprehensive type definitions
- Zero-Config: Works with environment variables, no manual configuration needed
- Flexible: Use server-side only, or add client hooks when needed
- Framework-Aligned: Follows TanStack Start patterns (loaders, middleware, server functions)
🚨 Important Notes
TanStack Start Compatibility
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 Function Execution Context
Server functions created with createServerFn can ONLY be called from:
- Route
loaderfunctions ✅ - Other server functions ✅
- Route server handlers ✅
NOT from:
- Route
beforeLoadfunctions ❌ (runs on both server and client) - Client components directly ❌ (use hooks instead)
See the README for detailed execution context information.
File Organization Matters
The SDK follows TanStack Start's bundler conventions:
- Server code lives in
src/server/ - Client code lives in
src/client/ - The bundler uses these paths to determine what code to include in which bundles
📚 Documentation
Complete documentation is available in the README.md, including:
- Quick start guide
- Environment variable configuration
- Usage examples for all APIs
- Integration patterns
- Troubleshooting guide
🔗 Resources
- GitHub Repository: https://github.com/workos/authkit-tanstack-start
- npm Package: https://www.npmjs.com/package/@workos/authkit-tanstack-react-start
- WorkOS Documentation: https://workos.com/docs/user-management
- TanStack Start Docs: https://tanstack.com/start/latest
🙏 Acknowledgments
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 library- The TanStack Start example implementation that proved the concept
🐛 Known Issues
- None at this time. Please report issues at https://github.com/workos/authkit-tanstack-start/issues
Install now:
npm install @workos/authkit-tanstack-react-startpnpm add @workos/authkit-tanstack-react-startGet started in 3 steps - see the README for the quickstart guide.