# setUserAttributes()

Sets user attributes for use in paywalls and on the Superwall dashboard.

> **Warning**

**Deprecated SDK**We strongly recommend migrating to the new [Superwall Expo SDK](/docs/expo), see our [migration guide](/docs/expo/guides/migrating-react-native) for details.



Purpose [#purpose]

Sets user attributes for use in paywalls and on the Superwall dashboard. If an attribute already exists, its value will be overwritten while other attributes remain unchanged. This is useful for analytics and campaign audience filters you may define in the Superwall Dashboard.

> **Note**

**Note:** These attributes should not be used as a source of truth for sensitive information.



Signature [#signature]

```typescript
async setUserAttributes(userAttributes: UserAttributes): Promise<void>
```

Parameters [#parameters]

<TypeTable
  type="{
  userAttributes: {
    type: &#x22;UserAttributes&#x22;,
    description: &#x22;An object containing custom attributes to store for the user. Values can be any JSON-encodable value, URLs, or Dates. Keys beginning with `$` are reserved for Superwall and will be dropped. Arrays and dictionaries as values are not supported and will be omitted.&#x22;,
  },
}"
/>

Returns / State [#returns--state]

Returns a Promise that resolves once the user attributes have been updated.

Usage [#usage]

```typescript
await Superwall.shared.setUserAttributes({
  name: user.name,
  email: user.email,
  username: user.username,
  profilePic: user.profilePicUrl,
  plan: "premium",
  signUpDate: new Date()
})
```

Best Practices [#best-practices]

* Set user attributes after calling [`identify()`](/docs/react-native/sdk-reference/identify)
* Update attributes whenever relevant user information changes
* Use attributes in campaign audience filters on the Superwall Dashboard
* Don't store sensitive information (passwords, tokens, etc.) as user attributes

Related [#related]

* [`getUserAttributes()`](/docs/react-native/sdk-reference/getUserAttributes) - Get user attributes
* [`identify()`](/docs/react-native/sdk-reference/identify) - Identify a user