fetchToken

suspend fun Session.fetchToken(options: GetTokenOptions = GetTokenOptions()): ClerkResult<TokenResource, ClerkErrorResponse>

Fetches a fresh JWT for the session.

Return

The ClerkResult containing the TokenResource if successful. On failure it carries the API error, the exception that interrupted the request, or a local error with code session_pending (the session has tasks to complete) or session_token_request_superseded (sign-out, reinitialization or reverification invalidated the request).

Parameters

options

The options to use when fetching the token.

See also