Overview
Cavos ships a pre-built authentication modal that handles the full login flow — provider selection, magic link email input, inbox confirmation screen, and wallet setup progress. You don’t need to build any auth UI yourself. The modal is fully self-contained: it callslogin(), sendMagicLink(), and subscribes to walletStatus internally. It closes automatically once walletStatus.isReady is true.
Setup
Pass themodal prop to CavosProvider. If the prop is omitted entirely, the modal is not mounted.
Modal Config Options
| Prop | Type | Default | Description |
|---|---|---|---|
appName | string | — | App name shown in the modal header: “Sign in to ”. If omitted, shows “Log in or sign up”. |
appLogo | string | — | Reserved for future use. |
providers | ('google' | 'apple' | 'email')[] | ['google', 'apple', 'email'] | Which auth methods to show. Omit any to hide it. |
primaryColor | string | '#0A0908' | Button color for the magic link submit action. |
theme | 'light' | 'dark' | 'light' | Color scheme. |
onSuccess | (address: string) => void | — | Called ~1.6s after the wallet is fully ready (walletStatus.isReady). |
Opening and Closing
UseopenModal() and closeModal() from useCavos():
useCavosAuth Convenience Hook
A minimal hook that exposes only what you need for a connect button:
useCavosAuth returns:
| Property | Type | Description |
|---|---|---|
openModal | () => void | Open the auth modal |
closeModal | () => void | Close the auth modal |
isAuthenticated | boolean | User has an active session |
address | string | null | Wallet address |
user | UserInfo | null | { id, email, name, picture } |
walletStatus | WalletStatus | Deployment and session state |
logout | () => Promise<void> | Clear session |
Modal Screens
The modal manages four internal screens automatically — you don’t control which screen is shown.1. Provider Selection (select)
The default screen. Shows whichever providers you configured.
- Email field (if
'email'is inproviders): typing an email and pressing Enter or clicking Submit advances to the magic-link screen - Google button: calls
login('google'), opens OAuth tab - Apple button: calls
login('apple'), opens OAuth tab
2. Magic Link Email (magic-link)
Shown when the user clicks Submit on the email field. Accepts the email address and calls sendMagicLink(email) on submit.
3. Check Your Inbox (verify)
Shown after the magic link is sent. Displays the destination email and a Resend link button with a 60-second cooldown. The user can also tap Use a different email to go back.
Authentication completes in the background — when the user clicks the magic link in their email, the modal automatically transitions to the deploying screen.
4. Wallet Setup (deploying)
Shown as soon as the user authenticates (OAuth or magic link). Displays a spinner while the SDK deploys the account and registers the session key. When walletStatus.isReady is true, the spinner becomes a checkmark and the modal closes after ~1.6s, firing onSuccess.
[!IMPORTANT]
The modal cannot be dismissed during the deploying screen. Clicking outside or pressing the close button has no effect. This prevents the user from navigating away before their wallet is ready.
Filtering Providers
Show only the methods your app supports:Using the Modal Component Directly
If you need more control — for example, to embed the modal inside a specific layout or manage theopen state yourself — you can import CavosAuthModal directly instead of using the modal prop on CavosProvider:
[!NOTE]CavosAuthModalmust be rendered inside a<CavosProvider>— it usesuseCavos()internally.
CavosAuthModalProps
Responding to Wallet Ready
onSuccess is the recommended way to react when the wallet is fully set up. For more granular control, observe walletStatus directly:
Theming
primaryColor controls the magic link submit button. The rest of the modal adapts automatically to the theme.

