---
url: https://talkjs.com/docs/UI_Components/Flutter/User
---

# User

Represent user data in your chat.

Ask a question Copy for LLM [View as Markdown](/docs/UI_Components/Flutter/User.md)

## class User

A user of your app. TalkJS uses the `id` to uniquely identify this user.
All other fields of a User are allowed to vary over time and the TalkJS
database will update its fields accordingly.

**NOTE**: A [User](/docs/UI_Components/Flutter/User/#User) object is created by calling either the [getUser](/docs/UI_Components/Flutter/Session/#Session__getUser) or [getUserById](/docs/UI_Components/Flutter/Session/#Session__getUserById) methods of the [Session](/docs/UI_Components/Flutter/Session/#Session) object.

### Properties

##### availabilityText

: String?

Availability acts similarly to [welcomeMessage](/docs/UI_Components/Flutter/User/#User__welcomeMessage) but appears as a [system message](/docs/Concepts/System_Messages/).

##### custom

: Map<String, String?>?

Allows you to set custom metadata for the User

##### email

: List<String>?

One or more email address belonging to the User.
The email addresses will be used for [Email Notifications](/docs/Features/Notifications/Email_Notifications/) if they are enabled.

##### id

: String

The unqiue ID which is used to identify the user in TalkJS

##### locale

: String?

The locale field expects an [IETF language tag](https://www.w3.org/International/articles/language-tags/).
See the [localization documentation](/docs/Features/Language_Support/#localization).

##### name

: String

The User's name which will be displayed on the TalkJS UI

##### phone

: List<String>?

One or more phone numbers belonging to the User.
The phone number will be used for [SMS Notifications](/docs/Features/Notifications/SMS_Notifications/) (this feature requires standard plan and up).

##### photoUrl

: String?

An optional URL to a photo which will be displayed as the user's avatar

##### role

: String?

TalkJS supports multiple sets of settings, called "roles".
These allow you to change the behavior of TalkJS for different users.
You have full control over which user gets which configuration.

##### welcomeMessage

: String?

The default message a user sees when starting a chat with that person