Skip to main content

userData

The parameter userData is used at launch to connect to directline as an already known user. If the user is recognized, the messages received can be customized. For example, the welcom message Hello ! can be transformed in Hello <user_firstname> !

NameRequiredTypeDefault valueDescription
idYesstringUser id, used for user recognition
nameYesstringUser's family name (not used)
usernameYesstringUser's first name (not used)
nomYesstringUser's family name
prenomYesstringUser's first name
emailYesstring?
tokenYesstring?
referrerYesstring?
ipaddressYesstring?

Here is an example of a default user, with an identifier being modified on each connexion :

const userData = {
name: '',
id: Math.random().toString(36).substring(2, 9),
username: '',
nom: '',
prenom: '',
email: '',
token: '',
referrer: '',
ipaddress: ''
}