JavaScript - Fluid Topics - Latest

Design a Custom Component

Category
How To
Audience
public
Version
Latest

The following JavaScript command performs two primary functions:

  • Identifies the user's authentication status.
  • Retrieves the user's name if authenticated.

Copy and paste this sample into the JavaScript section of the custom component editor.

if (user.isAuthenticated) {
  document.querySelector("#name").innerText = user.profile.displayName
}