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

# useIdentityToken

Deprecated

`useIdentityToken` is deprecated in v10. Use [useAuthTokenInfo](/embedded-wallets/sdk/react-native/hooks/useAuthTokenInfo/) instead. It returns the same token.

`useIdentityToken` is a wrapper around `useAuthTokenInfo` that exposes `getAuthTokenInfo` under the name `getIdentityToken`.

### Migrate to `useAuthTokenInfo`

```diff
- import { useIdentityToken } from '@web3auth/react-native-sdk'
+ import { useAuthTokenInfo } from '@web3auth/react-native-sdk'

- const { getIdentityToken, token, loading, error } = useIdentityToken()
- const idToken = await getIdentityToken()
+ const { getAuthTokenInfo, token, loading, error } = useAuthTokenInfo()
+ const idToken = await getAuthTokenInfo()

```

### Return type

```tsx
import { type IUseIdentityToken } from '@web3auth/react-native-sdk'

```

#### `getIdentityToken`

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

Same as [getAuthTokenInfo](/embedded-wallets/sdk/react-native/hooks/useAuthTokenInfo/#getauthtokeninfo).

#### `token`

`string | null`

Most recent identity token.

#### `loading`

`boolean`

`true` while the token is being fetched.

#### `error`

`Web3authRNError | null`

Error from the most recent call, or `null`.
