---
title: useBuyerAttributes
description: >-
  The useBuyerAttributes hook fetches shopping preference signals for
  personalization.
source_url:
  html: 'https://shopify.dev/docs/api/shop-minis/hooks/user/usebuyerattributes'
  md: 'https://shopify.dev/docs/api/shop-minis/hooks/user/usebuyerattributes.md'
---

# useBuyerAttributes

The `useBuyerAttributes` hook fetches shopping preference signals for personalization. Returns `genderAffinity` (MALE, FEMALE, or NEUTRAL) and `categoryAffinities` (list of product taxonomy categories the user engages with). Use this data to customize product recommendations, filter content, or tailor messaging. This is privacy-sensitive data derived from the user's Shop activity, always handle respectfully and transparently in your UI.

**Caution:**

This hook requires adding the following scopes to the manifest file:

`profile`

For more details, see [manifest.json](https://shopify.dev/docs/api/shop-minis/manifest-file).

## use​Buyer​Attributes(**[params](#props-propertydetail-params)**​)

### Parameters

* **params**

  **UseBuyerAttributesParams**

### Returns

* **UseBuyerAttributesReturns**

### UseBuyerAttributesParams

* fetchPolicy

  ```ts
  DataHookFetchPolicy
  ```

* skip

  ```ts
  boolean
  ```

### DataHookFetchPolicy

```ts
'cache-first' | 'network-only'
```

### UseBuyerAttributesReturns

* buyerAttributes

  ```ts
  BuyerAttributes | null
  ```

* error

  ```ts
  Error | null
  ```

* loading

  ```ts
  boolean
  ```

* refetch

  ```ts
  () => Promise<void>
  ```

### BuyerAttributes

* categoryAffinities

  ```ts
  TaxonomyCategory[]
  ```

* genderAffinity

  ```ts
  Gender
  ```

### TaxonomyCategory

* ancestors

  ```ts
  TaxonomyCategory[]
  ```

* id

  ```ts
  string
  ```

* name

  ```ts
  string
  ```

### Gender

```ts
'MALE' | 'FEMALE' | 'NEUTRAL'
```

Examples

### Examples

* ####

  ##### tsx

  ```tsx
  import {useEffect} from 'react'

  import {useBuyerAttributes} from '@shopify/shop-minis-react'

  export default function MyComponent() {
    const {buyerAttributes} = useBuyerAttributes()

    useEffect(() => {
      if (buyerAttributes) {
        const {genderAffinity, categoryAffinities} = buyerAttributes
        console.log({genderAffinity, categoryAffinities})
      }
    }, [buyerAttributes])
  }
  ```

***
