Authentication Methods
Cavos supports multiple authentication methods:| Method | Identity | Use Case |
|---|---|---|
| Google OAuth | Email, name, profile picture | Quick social login |
| Apple OAuth | Email (optionally hidden), name | Privacy-focused social login |
| Magic Link | Passwordless email login |
sub claim and a per-app salt — the same account produces the same address across devices.
Social Login (Google / Apple)
Login with Google
Login with Apple
How Social Login Works
- User clicks the login button
- SDK opens a new tab to the Google/Apple OAuth page
- User authenticates with their account
- The auth tab writes the result to localStorage and closes
- SDK derives the wallet address from the OAuth identity (
sub+ per-app salt) - Account deployment + session registration happen automatically in the background
walletStatus.isReadybecomestruewhen setup is complete
Your wallet address is deterministically derived from your OAuth identity. Same Google/Apple account = same wallet address across all devices.
Magic Link Authentication
Send a passwordless login link to a user’s email. Resolves immediately after the email is sent; authentication completes in the background when the user clicks the link.How Magic Link Works
sendMagicLink(email)sends the email and returns immediately- The SDK starts polling localStorage for the auth result
- When the user clicks the link in their email (in any tab or on another device), the result is written to localStorage
- Auth state (
isAuthenticated,address) updates automatically viaonAuthChange
Session Management
Check Authentication State
Logout
Session Restoration
The SDK automatically restores sessions on page load viainit(). If a valid session exists in browser storage, the wallet is restored without requiring the user to log in again.
Error Handling
JwtExpiredError
When the OAuth JWT has expired (typically after 1 hour),execute() throws a JwtExpiredError. The user must re-login.

