User
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.Constructor | Create a TalkJS User |
Availability acts similarly to welcomeMessage but appears as a system message.
One or more email address belonging to the User. The email addresses will be used for Email Notifications if they are enabled.
The locale field expects an IETF language tag. See the localization documentation.
One or more phone numbers belonging to the User. The phone number will be used for SMS Notifications (this feature requires standard plan and up).
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.
new User(options)
Use this constructor to synchronize user data with the TalkJS backend.
The fields id
, name
and email
are required. A warning will be emitted if role
is not specified.
Set email
to null
if you want to use TalkJS without email fallback.
Parameters
options
: UserOptionsinterface UserOptions
Availability acts similarly to User​.welcomeMessage but appears as a system message.
Allows you to set custom metadata for the User
One or more email address belonging to the User. The email addresses will be used for Email Notifications if they are enabled.
The locale field expects an IETF language tag. See the localization documentation.
One or more phone numbers belonging to the User. The phone number will be used for SMS Notifications (this feature requires standard plan and up).
An optional URL to a photo which will be displayed as the user's avatar
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.
The default message a user sees when starting a chat with that person
new User(id)
Only use this constructor if you're sure that a user by the given id
already exists in TalkJS (for instance, because you synchronized it via the REST API). Otherwise use the new User(options: object):
constructor instead.