Accessing Username of Requestor
You can access information about the requesting user from within the doLookup, onDetails, and onMessage hooks.
If you want to access the username
or id
of the requesting user from within the doLookup
onDetails
or onMessage
method you can easily do this by accessing the _request
property on the options
variable passed into the respective method. The _request
property contains a user
object which includes a username
and id
property.
The structure of the _request
property is as follows
The id
property is a unique internal identifier used by Polarity to track the user. The id
is a numeric
value and does not change even if the user updates their username
.
doLookup Example
Here is an example for how you would access the username
and id
of the requesting user from within the doLookup
method.
onDetails Example
onMessage Example
Last updated