> For the complete documentation index, see [llms.txt](https://docs.haven1.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.haven1.org/build/developer-tools/haven1-sdk/haven1-react-sdk/useidentity.md).

# useIdentity

## Function: useIdentity()

> **useIdentity**(`enabled`?, `filters`?): `object`

Custom hook to fetch identity details and referral information using the Haven1 SDK.

### Parameters

#### enabled?

`boolean`

Optional boolean to enable or disable the queries.

#### filters?

`string`\[]

Optional array of filters to apply to the identity query.

### Returns

`object`

#### identity

> **identity**: `UseQueryResult`<`undefined` | `FetchResponse`<{ `parameters`: { `cookie`: `undefined`; `header`: `undefined`; `path`: `undefined`; `query`: { `filters`: `string`; }; }; `requestBody`: `undefined`; `responses`: { `200`: { `content`: { `application/json`: { `address`: `string`; `countryCode`: `null` | `string`; `countryOfResidence`: `null` | `string`; `createdAt`: `string`; `email`: `string`; `emailVerified`: `boolean`; `id`: `number`; `idIssuingCountry`: `null` | `string`; `name`: `null` | `string`; `nationality`: `null` | `string`; `proofOfLiveliness`: `null` | `boolean`; `referralCode`: `string`; `referredById`: `null` | `number`; `region`: `null` | `string`; `updatedAt`: `string`; }; `multipart/form-data`: { `address`: `string`; `countryCode`: `null` | `string`; `countryOfResidence`: `null` | `string`; `createdAt`: `string`; `email`: `string`; `emailVerified`: `boolean`; `id`: `number`; `idIssuingCountry`: `null` | `string`; `name`: `null` | `string`; `nationality`: `null` | `string`; `proofOfLiveliness`: `null` | `boolean`; `referralCode`: `string`; `referredById`: `null` | `number`; `region`: `null` | `string`; `updatedAt`: `string`; }; `text/plain`: { `address`: `string`; `countryCode`: `null` | `string`; `countryOfResidence`: `null` | `string`; `createdAt`: `string`; `email`: `string`; `emailVerified`: `boolean`; `id`: `number`; `idIssuingCountry`: `null` | `string`; `name`: `null` | `string`; `nationality`: `null` | `string`; `proofOfLiveliness`: `null` | `boolean`; `referralCode`: `string`; `referredById`: `null` | `number`; `region`: `null` | `string`; `updatedAt`: `string`; }; }; `headers`: {}; }; `404`: { `content`: { `application/json`: { `error`: `string`; }; `multipart/form-data`: { `error`: `string`; }; `text/plain`: { `error`: `string`; }; }; `headers`: {}; }; `500`: { `content`: { `application/json`: { `message`: `unknown`; `status`: `string`; }; `multipart/form-data`: { `message`: `unknown`; `status`: `string`; }; `text/plain`: { `message`: `unknown`; `status`: `string`; }; }; `headers`: {}; }; }; }, { `params`: { `query`: { `filters`: `undefined` | `string`; }; }; }, \`${string}/${string}\`>, `Error`>

Query for fetching identity details.

#### referral

> **referral**: `UseQueryResult`<`undefined` | `FetchResponse`<{ `parameters`: { `cookie`: `undefined`; `header`: `undefined`; `path`: `undefined`; `query`: `undefined`; }; `requestBody`: `undefined`; `responses`: { `200`: { `content`: { `application/json`: { `referralCode`: `string`; `unverified`: { `referredUsers`: `number`; `referredUsersLast7Days`: `number`; }; `verified`: { `referredUsers`: `number`; `referredUsersLast7Days`: `number`; }; }; `multipart/form-data`: { `referralCode`: `string`; `unverified`: { `referredUsers`: `number`; `referredUsersLast7Days`: `number`; }; `verified`: { `referredUsers`: `number`; `referredUsersLast7Days`: `number`; }; }; `text/plain`: { `referralCode`: `string`; `unverified`: { `referredUsers`: `number`; `referredUsersLast7Days`: `number`; }; `verified`: { `referredUsers`: `number`; `referredUsersLast7Days`: `number`; }; }; }; `headers`: {}; }; `404`: { `content`: { `application/json`: { `error`: `string`; }; `multipart/form-data`: { `error`: `string`; }; `text/plain`: { `error`: `string`; }; }; `headers`: {}; }; `500`: { `content`: { `application/json`: { `message`: `unknown`; `status`: `string`; }; `multipart/form-data`: { `message`: `unknown`; `status`: `string`; }; `text/plain`: { `message`: `unknown`; `status`: `string`; }; }; `headers`: {}; }; }; }, `undefined` | `FetchOptions`<{ `parameters`: { `cookie`: `undefined`; `header`: `undefined`; `path`: `undefined`; `query`: `undefined`; }; `requestBody`: `undefined`; `responses`: { `200`: { `content`: { `application/json`: { `referralCode`: ...; `unverified`: ...; `verified`: ...; }; `multipart/form-data`: { `referralCode`: ...; `unverified`: ...; `verified`: ...; }; `text/plain`: { `referralCode`: ...; `unverified`: ...; `verified`: ...; }; }; `headers`: {}; }; `404`: { `content`: { `application/json`: { `error`: ...; }; `multipart/form-data`: { `error`: ...; }; `text/plain`: { `error`: ...; }; }; `headers`: {}; }; `500`: { `content`: { `application/json`: { `message`: ...; `status`: ...; }; `multipart/form-data`: { `message`: ...; `status`: ...; }; `text/plain`: { `message`: ...; `status`: ...; }; }; `headers`: {}; }; }; }>, \`${string}/${string}\`>, `Error`>

Query for fetching identity referral information.

### Defined in

[packages/react/src/api/hook/useIdentity.ts:8](https://github.com/haven1network/haven1-sdk/blob/7cd51fbeb78d9011a6b1c4b8e514287b0d830453/packages/react/src/api/hook/useIdentity.ts#L8)
