Components
User Button
A Better Auth user menu with a central-auth-backed account dialog, localized labels, and sign-out handling.
Install
Add this registry item to your app with shadcn.
bunx --bun shadcn@latest add https://krakstack.net/r/user-button.jsonOverview
user-button provides a compact authenticated-user dropdown for apps that use Krakstack Auth as a central identity provider. It reads the visible app session from the app-local authClient.useSession(), then uses centralAuthClient for central account mutations like profile updates, linked accounts, password settings, two-factor authentication, and user API keys.
Features
- App-local Better Auth session display
- Central Krakstack Auth account mutations through
centralAuthClient - Profile, linked accounts, password, 2FA, and API-key dialogs
- Reconnect state when the app session exists but the central auth session is missing
- Localized menu and form labels
- Configurable sign-out redirect
- Configurable dropdown side
Usage
import { UserButton } from "@/components/ui/user-button";
<UserButton signOutRedirect="/" side="bottom" />Set VITE_KRAKSTACK_AUTH_URL to your central auth origin, for example http://localhost:3001.
Dependencies
Packages and shadcn components required by this registry item.
Preview
User Menu
This preview uses the site-local Better Auth client.