Client object¶
With Alan AI’s client
object, you can get general information about users interacting with the AI agent:
Approximate user’s location
Interactions statistics for the user
In the example below, Alan AI writes to logs information about every user interacting with the AI agent and user events.
onUserEvent((p, e)=> {
console.log(e, p.client);
});
Client object data¶
The client
object provides the following user data:
{
geoLoc: {
city: 'Sunnyvale',
continent: 'North America',
country: 'United States',
lat: 37.3479,
lon: -122.0351,
source: 'ip-address'
},
ip: '67.195.198.201',
stats: {
interactions: 0,
lastConnectTs: 1617975166387,
lastInteractionTs: 0,
recognized: 0,
unrecognized: 0
},
timeZone: 'America/Los_Angeles'
}
Field name |
Data type |
Description |
---|---|---|
|
String |
User’s city |
|
String |
User’s continent |
|
Float |
Latitude of the user’s position |
|
Float |
Longitude of the user’s position |
|
String |
Data source |
|
String |
User’s IP address |
|
Integer |
Number of interactions with the user |
|
Integer |
Timestamp of the last connection to the AI agent |
|
Integer |
Timestamp of the last interaction with the AI agent |
|
Integer |
Number of recognized user’s interactions |
|
Integer |
Number of unrecognized user’s interactions |
|
String |
User’s time zone |