Skip to main content

How to pass member data like user email and user key into HTML embed?

Hi all! Simple quick question, how can I pass member data into HTML embed? Just looking to pass 'user-email' and 'user-key'

3 comments

  • A J
    A J

    Hey Alessandro De La Torre, in case you save this data in Webflow CMS or any CMS that you have access to via the page, you can embed it directly via the "Add Field" button in HTML embed dialog box.

    But in case the page you are creating is not directly connected to the members data you can try fetching the details you want via a script

    window.$memberstackDom.getCurrentMember().then((member) => {
    if (member.data) {
    var id = member.data.id;
    var emailID = member.data.auth.email;
    }
    })

    This will fetch the logged-in member's memberstack ID and email.
    Let me know if this works

    0
  • Duncan from Memberstack
    Duncan from Memberstack

    You can also use the attributes data-ms-member="email" and data-ms-member="id"

    0
  • Alessandro De La Torre
    Alessandro De La Torre OP

    Thank you!

    0

Please sign in to leave a comment.

Sitemap