Components
<AuthUIProvider>
The <AuthUIProvider>
wraps your application with authentication context, providing essential hooks, settings, and methods required by authentication-related components and hooks throughout your app.
Usage
Reference
The following props can be passed to the <AuthUIProvider>
component:
Prop | Type | Default |
---|---|---|
passwordValidation? | PasswordValidation | - |
Link? | any | <a> |
uploadAvatar? | (file: File) => Promise<string> | - |
replace? | ((href: string) => void) | navigate |
onSessionChange? | (() => void | Promise<void>) | - |
navigate? | ((href: string) => void) | window.location.href |
username? | boolean | false |
twoFactor? | ("otp" | "totp")[] | undefined |
signInSocial? | ((params: any) => Promise<unknown>) | - |
signUpFields? | string[] | ["name"] |
signUp? | boolean | true |
settingsURL? | string | - |
settingsFields? | string[] | ["name"] |
rememberMe? | boolean | false |
otherProviders? | Provider[] | false |
providers? | SocialProvider[] | - |
persistClient? | boolean | false |
passkey? | boolean | false |
optimistic? | boolean | false |
oneTap? | boolean | false |
noColorIcons? | boolean | false |
nameRequired? | boolean | true |
multiSession? | boolean | false |
emailOTP? | boolean | false |
magicLink? | boolean | false |
freshAge? | number | 60 * 60 * 24 |
forgotPassword? | boolean | true |
emailVerification? | boolean | - |
deleteUser? | boolean | false |
changeEmail? | boolean | true |
deleteAccountVerification? | boolean | false |
redirectTo? | string | "/" |
credentials? | boolean | true |
confirmPassword? | boolean | false |
colorIcons? | boolean | false |
captcha? | { siteKey: string; provider: CaptchaProvider; hideBadge?: boolean | undefined; recaptchaNet?: boolean | undefined; enterprise?: boolean | undefined; endpoints?: string[] | undefined; } | - |
baseURL? | string | - |
basePath? | string | "/auth" |
avatarSize? | number | 128 | 256 |
avatarExtension? | string | "png" |
avatar? | boolean | false |
additionalFields? | AdditionalFields | - |
mutators? | Partial<AuthMutators> | - |
localization? | AuthLocalization | authLocalization |
toast? | RenderToast | Sonner |
viewPaths? | AuthViewPaths | authViewPaths |
hooks? | Partial<AuthHooks> | - |
authClient | AuthClient | Required |
children | ReactNode | - |
Example
A minimal Next.js layout file using the AuthUIProvider
: