In Server Side Rendering scenarios where you have access to the whole DOM, you can subscribe to our custom events before the widget even starts to load. In this case there is no risk of missing the initial event(s).
consthandleReady= ({ detail }) => {// Your code}; document.addEventListener('MemberSpace.ready', handleReady);consthandleMemberInfo= ({ detail }) => {// Your code};document.addEventListener('MemberSpace.member.info', handleMemberInfo);//MS install code ... Please see the relevant sectionvar MemberSpace =window.MemberSpace || {subdomain:"YOUR_SUBDOMAIN"};(function(d){var s =d.createElement("script");s.src ="https://cdn.memberspace.com/scripts/widgets.js";var e =d.getElementsByTagName("script")[0];e.parentNode.insertBefore(s,e);}(document));