# useIdentityToken

> @web3auth/modal Vue Composable useIdentityToken | Embedded Wallets

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

### Import

```ts

```

### Usage

```html
<script setup lang="ts">

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

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

### Return type

```ts

```

#### `loading`

`Ref<boolean>`

Whether the authentication process is in progress.

#### `error`

`Ref<Web3AuthError | null>`

Error that occurred during the authentication process.

#### `token`

`Ref<string | null>`

The identity token returned after successful authentication.

#### `getIdentityToken`

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

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