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

1webflow.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

1// Get ID Token
2const idToken = await webflow.getIdToken()
3
4// Print ID Token
5console.log(idToken)