CavosProvider
The provider component that initializes the SDK and provides context to child components.Config Props
Modal Props
useCavos Hook
Access SDK functionality from any child component:State Properties
| Property | Type | Description |
|---|---|---|
isAuthenticated | boolean | User has an active OAuth session |
user | UserInfo | null | User info from OAuth (id, email, name, picture) |
address | string | null | Wallet address (0x...) |
isLoading | boolean | SDK is initializing or processing |
hasActiveSession | boolean | User is authenticated with a valid session |
walletStatus | WalletStatus | Detailed wallet deployment and session state |
sessionPublicKey | string | null | Public key of the current session key (safe to display) |
WalletStatus
[!NOTE]walletStatus.isReadyistrueonly when the account is deployed and the session is registered. Both steps happen automatically afterlogin()— no manual calls needed.
Auth Methods
login(provider)
Start authentication flow — opens a new tab to Google/Apple OAuth:sendMagicLink(email)
Send a magic link email. Resolves immediately after the email is sent; authentication completes in the background when the user clicks the link.logout()
Clear session and wallet state:Transaction Methods
execute(calls, options?)
Execute transactions. Handles session registration automatically on first call.| Session State | gasless: true | gasless: false |
|---|---|---|
| Not registered | JWT signature — registers + executes atomically ✅ | Throws ❌ |
| Registered & active | Session signature via Paymaster ✅ | Session signature, wallet pays STRK ✅ |
| Expired (within grace) | Auto-renews, then executes ✅ | Auto-renews, then executes ✅ |
| Expired (beyond grace) | Throws SESSION_EXPIRED ❌ | Throws SESSION_EXPIRED ❌ |
signMessage(typedData)
Sign SNIP-12 typed data with the session key:Session Management
registerCurrentSession()
Explicitly register the session key on-chain using the current JWT. Normally called automatically — only needed for advanced flows.[!IMPORTANT] CallupdateSessionPolicy(policy)beforeregisterCurrentSession()if you changed the policy after login. See the policy sync rule below.
updateSessionPolicy(policy)
Update the session policy that will be embedded on-chain during registration.[!WARNING] If you callregisterCurrentSession()without updating the policy first, the stale policy from login time gets registered. If that policy was empty,policy_count == 0on-chain — spending limits are skipped entirely.
renewSession()
Renew an expired session key. Requires the session to be registered on-chain and expired within the grace period (default: 48h after expiry).revokeSession(sessionKey)
Revoke a specific session key on-chain. Requires JWT verification.emergencyRevokeAllSessions()
Revoke all session keys by incrementing the on-chain revocation epoch. Use if you suspect a key was compromised.[!WARNING] This invalidates all sessions immediately. The user must re-login to transact again.
exportSession()
Export the current session as a base64-encoded token for use in the Cavos CLI or autonomous agents.[!NOTE] The exported token contains the session private key. Store it securely and never share it publicly.
Account Methods
deployAccount()
Manually deploy the account contract. Normally called automatically afterlogin().
isAccountDeployed()
Check if the account contract is deployed on-chain.getBalance()
Get the ETH balance of the wallet (as a string in wei).getAssociatedWallets()
Discover all wallets associated with the current user.switchWallet(name?)
Switch the active wallet by name (for multi-wallet users).SessionKeyPolicy Reference
[!CAUTION]limitmust be abigint. Usingnumbersilently truncates large values.

