This information relates to a feature that hasn't been released yet.
Sometimes you want to know about the currently signed in user in the webpage so that you can spawn integrations with third partly libraries. Some examples of this are:
- You want to add a third party chat application to your page and their provided snippet requires you to supply it with a username and email address.
- You have a third party analytics application and you want to send the current user's SSO ID to it so that you can link users to your own information in your data warehouse.
The best way to do this is with the following Javascript:
window.onVanillaReady(function (vanilla) {
var user = vanilla.getCurrentUser()
});
This will fill the user
variable with an object filled with the current user's information. It's important that you put your code in the onVanillaReady
event handle in order to handle deferred script loading.
The information in this variable comes from the /api/v2/users/me
endpoint. Check out your dashboard for more information on the fields there. Or, you can always call the endpoint from within your dashboard to see a live sample.