> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# setUserAttributes()

> Store structured user attributes for targeting and analytics

Sets structured user attributes used for offer targeting, personalization, and analytics. Attributes are merged with any existing values — they are not replaced.

## Signature

```tsx theme={null}
setUserAttributes(attributes: UserAttributes): Promise<{ success: boolean }>
```

## Parameters

| Name         | Type                                | Description                                       |
| ------------ | ----------------------------------- | ------------------------------------------------- |
| `attributes` | [UserAttributes](./user-attributes) | Structured attributes to set for the current user |

<Info>
  `setUserAttributes()` **merges** with existing attributes. To clear attributes, call [`reset()`](./reset).
</Info>

## Usage

```tsx theme={null}
await Encore.setUserAttributes({
  email: 'user@example.com',
  subscriptionTier: 'premium',
  monthsSubscribed: '6',
  custom: {
    cancelReason: 'too_expensive',
  },
});
```
