For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

Logout user

To sign out the user, use the logout method. It invalidates the current session, clears the session data that the SDK stored in the Keychain, and sets web3Auth.web3AuthResponse to nil. The user must sign in again to use the dapp the next time the dapp is opened.

warning

logout deletes every generic password item in your app's Keychain, not only the items the SDK created. This includes your app's own generic password items and any stored dapp shares. Store data you need to keep after sign-out in another Keychain item class or another storage location.

Usage​

try await web3Auth.logout()
On this page