Auth Provider
better-auth-ui/auth-providerFreeComponent
Wraps the Better Auth UI provider and mounts an ErrorToaster that surfaces query and mutation failures via sonner.
Live preview
live · rendered by the registry
Rendered by better-auth-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://better-auth-ui.com/r/auth-provider.jsonSource
1import {2 AuthProvider as AuthProviderPrimitive,3 type AuthProviderProps4} from "@better-auth-ui/react"5import type {6 ComponentPropsWithoutRef,7 ComponentType,8 PropsWithChildren,9 ReactNode10} from "react"1112import { ErrorToaster } from "./error-toaster"1314declare module "@better-auth-ui/core" {15 interface AuthConfig {16 /**17 * React component used to render internal navigation links.18 * Typically TanStack Router's `Link` or Next.js's `Link`.19 */20 Link: ComponentType<21 PropsWithChildren<22 { className?: string; href: string; to?: string } & Pick<23 ComponentPropsWithoutRef<"a">,24 "aria-disabled" | "tabIndex" | "onClick"25 >26 >27 >28 }2930 /** Widen `AdditionalField.label` to `ReactNode` in the shadcn package. */31 interface AdditionalFieldRegister {32 label: ReactNode33 }34}3536/**37 * Provides an authentication context by rendering an auth provider with the sonner toast handler injected, forwarding remaining configuration and rendering `children` inside it.38 *39 * @param children - React nodes to render inside the authentication provider40 * @returns A React element that renders an authentication provider configured with the provided props and toast handler41 */42export function AuthProvider({ children, ...config }: AuthProviderProps) {43 return (44 <AuthProviderPrimitive {...config}>45 {children}4647 <ErrorToaster />48 </AuthProviderPrimitive>49 )50}
What it pulls in
npm packages
Other registry items
Files it writes
More from better-auth-ui
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Account Settingsaccount-settings | better-auth-ui | Components | Free | 2 deps | |
| Active Sessionsactive-sessions | better-auth-ui | Components | Free | 5 deps · 2 files | |
| Additional Fieldadditional-field | better-auth-ui | Components | Free | 5 deps | |
| Adminadmin | better-auth-ui | Components | Free | 4 deps · 3 files | |
| Anonymousanonymous | better-auth-ui | Components | Free | 4 deps · 3 files | |
| API Keyapi-key | better-auth-ui | Components | Free | 4 deps · 10 files | |
| Authauth | better-auth-ui | Components | Free | 2 deps | |
| Auth Redirectauth-redirect | better-auth-ui | Components | Free | 3 deps |
