How to fix MemberStack not defined and 404 errors when accessing member data in Webflow?
Hi,
I am trying to access logged in member data on a page through a custom code snippet on webflow. I tried to use the Memberstack frontend API code and inserted the following into custom code in the footer section.
MemberStack.onReady.then(async function(member) {
var metadata = await member.getMetaData()
// do stuff with members data
})
However, when I run the page I get the following error in console.
Uncaught ReferenceError: MemberStack is not defined
I am not able to access any data of the logged in user. However, the user is clearly logged in and the page is linked and accessing data since my dynamic text is updated with the user's name.
Any help would be greatly appreciated!
Comments
2 comments
Hey Starr Wen
Looks like you're using Memberstack 1.0 code. Please see checkout article to see what's different in 2.0.
https://docs.memberstack.com/hc/en-us/articles/7253211946523-Converting-Memberstack-1-0-Code-to-2-0-Code
Here's the code you're looking for:
Hey Duncan from Memberstack,
I have tried using your solution however am still getting errors. Here are the steps I've done so far:
1. Added this code to my page header...
2. Have added this code to the </body> custom code section of my webflow site:
but I still get console errors, here's a screenshot:
Seems as though there's a 404 error for the JS library. Any help is hugely appreciated because this is holding up my entire project and there isn't much good documentation out there.
Kind regards,
Will
Please sign in to leave a comment.