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

Get access token

Use the getAccessToken method to retrieve the access token for the user's current auth session. The native Android and iOS SDKs manage the session and refresh it as needed.

This method is available from v8.

Usage​

try {
final String accessToken = await Web3AuthFlutter.getAccessToken();
} catch (e) {
// Thrown when no authenticated session is present.
log(e.toString());
}

Errors​

getAccessToken throws when no authenticated session is present. Call it after a successful connectTo, or after initialize restores a session.

On this page