# useIdentityToken

> @web3auth/modal React Hooks useIdentityToken | Embedded Wallets

Hook to retrieve and manage the identity token from Embedded Wallets.

### Import

```tsx

```

### Usage

```tsx

function IdentitytTokenButton() {
  const { getIdentityToken, loading, error, token } = useIdentityToken()

  return (
    
      <button onClick={() => getIdentityToken()} disabled={loading}>
        {loading ? 'Authenticating...' : 'Get Identity Token'}
      </button>
      {token && Token: {token}}
      {error && Error: {error.message}}
    
  )
}
```

### Return type

```tsx

```

#### `loading`

`boolean`

Whether the authentication process is in progress.

#### `error`

`Web3AuthError | null`

Error that occurred during the authentication process.

#### `token`

`string | null`

The identity token returned after successful authentication.

#### `getIdentityToken`

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

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