APIsChangelog
Log In

Get user ID token

webflow.getIdToken()

Retrieves an idToken for the current user, which provides information on who is currently using your app. The idToken is a JSON Web Token (JWT) that can be resolved by sending a POST request to the Resolve ID Token endpoint. This endpoint will respond with details that can be used to authenticate a user.

Syntax

webflow.getIdToken(): Promise<string>;

Returns

Promise<String>

A Promise that resolves to the value of the ID Token. The ID token will remain valid for 15 minutes.

Example

// Get ID Token
const idToken = await webflow.getIdToken()

// Print ID Token
console.log(idToken)