Constructor
CavosConfig
Initialization
init()
CavosProvider — only use directly when not using React.
handlePopupCallback() (static)
true if this window is a popup child (and will close itself). Called automatically by CavosProvider.
Authentication
login(provider)
sendMagicLink(email)
onAuthChange() to be notified.
handleCallback(authDataString)
logout()
isAuthenticated()
getUserInfo()
{ id, email, name, picture } from the JWT claims, or null if not authenticated.
Wallet
getAddress()
getBalance()
isAccountDeployed()
deployAccount()
getWalletStatus()
onWalletStatusChange(listener)
onAuthChange(cb)
getSessionPublicKey()
getAssociatedWallets()
switchWallet(name?)
name to switch back to the default wallet.
getFundingAddress()
getAddress(). Returns the address to send funds to.
Transactions
execute(calls, options?)
gasless: true(default) — Cavos Paymaster sponsors gasgasless: false— wallet pays gas from its own STRK balance (requires session already registered)
SESSION_EXPIRED | Throws SESSION_EXPIRED |
executeOnSlot(calls)
JwtExpiredError— JWT has expired; user must re-loginError('SESSION_EXPIRED')— session expired past grace period; user must re-loginError('non-sponsored transaction without a registered session')—gasless: falsebefore first tx
signMessage(typedData)
[SESSION_V1_magic, r, s, session_key] — ready for on-chain is_valid_signature.
Session
registerCurrentSession()
Call updateSessionPolicy() before this if the policy changed after login.
updateSessionPolicy(policy)
registerCurrentSession() if the policy changed after login.
renewSession()
Error('Session is still active (Xh Ym remaining)')— not expired yetError('Session expired outside the grace period')— must re-loginError('Session not registered on-chain yet')— execute a transaction first
revokeSession(sessionKey)
getSessionPublicKey() to revoke the current session.
emergencyRevokeAllSessions()
After this, the user must re-login to transact again.
exportSession()
Onramp
getOnramp(provider)
Error('Onramp feature is not available on Sepolia network.')Error('No account connected.')
Advanced
getAccount()
null in OAuth mode. Use execute() instead of accessing the Account directly.
