> For the complete documentation index, see [llms.txt](/llms.txt).

# useIdentityToken

Composable to retrieve and manage the identity token from Embedded Wallets in Vue.

### Import[​](#import "Direct link to Import")

```
import { useIdentityToken } from '@web3auth/modal/vue'

```

### Usage[​](#usage "Direct link to Usage")

```
<script setup lang="ts">
  import { useIdentityToken } from '@web3auth/modal/vue'

  const { getIdentityToken, loading, error, token } = useIdentityToken()
</script>

<template>
  <div>
    <button @click="getIdentityToken" :disabled="loading">
      {{ loading ? "Authenticating..." : "Get Identity Token" }}
    </button>
    <div v-if="token">Token: {{ token }}</div>
    <div v-if="error">Error: {{ error.message }}</div>
  </div>
</template>

```

### Return type[​](#return-type "Direct link to Return type")

```
import type { IUseIdentityToken } from '@web3auth/modal/vue'

```

#### `loading`[​](#loading "Direct link to loading")

`Ref<boolean>`

Whether the authentication process is in progress.

#### `error`[​](#error "Direct link to error")

`Ref<Web3AuthError | null>`

Error that occurred during the authentication process.

#### `token`[​](#token "Direct link to token")

`Ref<string | null>`

The identity token returned after successful authentication.

#### `getIdentityToken`[​](#getidentitytoken "Direct link to getidentitytoken")

`() => Promise<string | null>`

Function to initiate the authentication process and retrieve the identity token.
