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.
If you have client synchronization enabled, only id
and name
are required for TalkJS to function.
Otherwise, if client synchronization is disabled, then you MUST only have the id
present.
Note that without email
set to a valid value,
TalkJS can't send email notifications to users who are offline.
1{2 id: "123456789",3 name: "Alice",5 photoUrl: "https://talkjs.com/images/avatar-1.jpg",6 welcomeMessage: "Hey, how can I help?"7 custom: {8 country: "ca"9 },10 locale: "en-US"11};
Field | Type | Description |
---|---|---|
string | The unique ID which is used to identify the user in TalkJS | |
string | The User's name which will be displayed on the TalkJS UI | |
string | string[] | null | Zero or more email address used for email notifications if enabled | |
string | string[] | null | Zero or more phone numbers used for SMS notifications | |
string | null | The default message a user sees when starting a chat with that person | |
string | null | URL to a photo which will be displayed as the user's avatar | |
string | null | One of the user roles that you can set up from the Roles page of your TalkJS dashboard. You can vary many settings per user role, such as the content of their email or SMS notification, the look and feel of the UIs, and forbidden words. Make sure the role corresponds precisely to a role name you chose in the dashboard. | |
CustomData | null | JSON-structured custom data that you wish to associate to this user. TalkJS does nothing with this data except make it available in the events that we send to your code and in your Email/SMS notification templates. You can use custom data for all kinds of purposes, such as customizing a user's email notification text, transmitting contextual user data, or making email login tokens | |
string | null | Availability acts similarly to welcomeMessage but appears as a system message. | |
string | null | An IETF language tag that sets a language and date format for this user. Note: you set the default locale for your entire app on the Settings page of your TalkJS dashboard. See the localization documentation. |