User presence
This component is to know if the user had a session recently.
The information gets filled automatically by the navigation bar when it is enabled. Check events-manage to see how to enable it.
How to use it
Add the following tag in your page
<user-presence/>
The following properties can be used as attributes:
- @Prop() renderType?: "none" | "button" = "none";
Example:
<user-presence render-type="button""/>
Reading data
It case you just want to use it to retrieve information, you can read data and not display anything:
<user-presence render-type="none""/>
Then, you can use the following methods:
await document.querySelector("user-presence").username(); // Will return null if no data
await document.querySelector("user-presence").timeSinceLatestSessionCheckInMs(); // Will return null if no data