Users consume ALOT of our custom code snippets. These are some challenges they encounter:
- snippets are tricky to configure (for non-technical users)
- snippets take up significant space in Webflow making it hard to manage and organize code
- if code needs to be updated or optimized, users will have to do that themselves
Proposal
By making a standalone, static S library that works alongside msDOM, we can:
- abstract away complex code from non-technical users
- keep users’ code cleaner and more organized on their sites
- update the code on behalf of users every time we want to optimize functionality
- reduce custom code support tickets in Slack / Zendesk
- speed up workflow & setup time for custom templates that we release
- release experimental methods that we want to share without compromising stability of DOM package
Docs
H2 - Getting The Logged In Member
Add the following script to the top of the BODY section in global site settings:
<script
src="<https://memberstack.github.io/memberstack-x/dist/memberstack-x.es.js>">
</script>
<script>
let MSX = window.Msx
Msx.getMember( ({ member, isLoggedIn, hooks }) => {
if(isLoggedIn) {
console.log("raw member object: ", member)
// member data is available, do stuff here
} else {
// or do other stuff here if member is not logged in
}
});
</script>
H3 - Smart Hooks