There can be a scenario where a particular widget needs are scenarios that require a widget to access the user information of current the user who is currently logged in user. For that, this purpose an API has been introduced to the widget developer via the base widget component.
Follow To access user information, follow the steps mentioned below to access user information. Please note that this below:
Info |
---|
This API currently exposes only the username of the current user. |
...
NOTE: This guide assumes that you already have a widget which is deployable in dashboard portal.
...
Tip | ||||
---|---|---|---|---|
| ||||
A widget that can be deployed in the Dashboard Portal must already exist. |
- Ensure that your widget is extended from the base widget provided by the dashboard portal. If not please refer “For more information, see Extending from base widget component”.
Call the following method to get the user information.
Code Block language js const userInfo = super.getCurrentUser();
...
Info |
---|
This feature is demonstrated by the sample widget named |
...
this widget here. |