Skip to main content
Solved

Get user object on site load

  • May 20, 2025
  • 6 replies
  • 42 views

  • Contributor ⭐️⭐️

Hi everyone, could you please tell me how I can retrieve the user object when the site loads? I'm particularly interested in displaying the user's email in the UI. Is this possible, and how can it be implemented? Thanks in advance!

Best answer by olimarrio

@jvdc exactly right it’s a security issue to include the email address in this object.

@Vadym the following answer to this question provides a workaround of how you can achieve this:

Thanks!

6 replies

Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • May 20, 2025

Hey ​@Vadym - I think the best place for you to start is probably the inSidedData Object:

It won’t give you the email address natively, but it will give you the ID and username of the visitor.


  • Author
  • Contributor ⭐️⭐️
  • May 20, 2025

Hey ​@Vadym - I think the best place for you to start is probably the inSidedData Object:

It won’t give you the email address natively, but it will give you the ID and username of the visitor.

Hi, thanks for the response! 🙃
I’ve looked into that object, but unfortunately it doesn’t provide access to the email.
I also tried making an API request, but I’m getting an error.
I’d really like to understand how to do this properly step by step 🤔


Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • May 20, 2025

Gotcha ​@Vadym - building something like that is beyond my skills but hopefully someone more technical will chime-in.  :)


jvdc
  • Helper ⭐️⭐️⭐️
  • May 21, 2025

Hey, there is perhaps a data protection reason why you can't retrieve user email addresses like that, no?


olimarrio
Forum|alt.badge.img+5
  • Gainsight Employee ⭐️
  • Answer
  • May 21, 2025

@jvdc exactly right it’s a security issue to include the email address in this object.

@Vadym the following answer to this question provides a workaround of how you can achieve this:

Thanks!


  • Author
  • Contributor ⭐️⭐️
  • May 21, 2025

@olimarrio thanks a lot!