Gating an HTML website to work with Memberstack - documentation non existent - How does one do it
Dear community,
I need to gate pages on an HTML website but the documentation is all geared around Webflow which I do not want to use.
Memberstack's AI suggests to add a V1 code snippet to the header
<!-- Memberstack install script -->
<script data-memberstack-app="YOUR_APP_ID" src="https://static.memberstack.com/scripts/v1/memberstack.js" type="text/javascript"></script>
but the documentation tells me not to use v1. I logged in to get started and it asks what kind of website I need to add memberstack to. The three choices are Webflow, react and other so I selected other. Step 1 tells me to ad the following to the page headers
import memberstackDOM from '@memberstack/dom';
const memberstack = memberstackDOM.init({
publicKey: "pk_sb_6c5af834ca04073965a0",
});
But to work that would need some kind of source to be indicated.
Their AI tells me toi use v1 but their documentation tells me not to use V1 as it is not supported. Has anyone managed to add memberstack to an HMTL website and if yes, where on earth is the documentation?
I want to use Memberstack as Stripe Taaxes can be used.
Any help would be greatly appreciated.
Comments
5 comments
Hey Tim Phizackerley
Thank you for posting. The v1 in the script you shared is for v2. It's confusing but the actual 1.0 script is completely different. We have a couple different packages for v2. If you want to use data attributes you can still use the webflow package which is a wrapper around the DOM package that adds data attributes. If you dont need data attributes we suggest using the DOM package which is the main javascript package. Here are all the docs for these packages.

You can also get to the install info in Memberstack by going here after you have logged in.
I appreciate your reply but unfortunately this doesn't help me at all. The first instruction on the on the DOM package is to do an installl via npm or yarn. But that looks like a server side function of some kind? and I am building an HTMLwebsite. the documentation does not explain at all where to install them, or whether this is a temporary or permanent thing. And it surely can't be pasted into an HTML webs page. The documentation is not helpful as it simply says: I am totally stuck. I am sure memberstack can do what I need but the documentation seems to be woeful unless one is using webflow which I am not. Documentation states:
You can install the Memberstack DOM package from either the npm public registry or yarn.
I apologize for assuming you were building an HTML website with a package manager. I havent seen anyone build a site without one for many years. In this case the best thing to use would be the Webflow package that has the DOM package included. To use it you would add the script to your <head>. The majority of our customers are using Webflow and this is why most of our content is targeted for Webflow users. Here is a simple example of an html setup.
Thank you Josh. I appreciate your reply and have given up for now because although Memberstack adviertise usabilty on any web content it doesn't seem to be tje case and certainly there seems to be no documentation to explain how to do it. I think I have little choice but to attempt to somehow incorporate my complex content within a webflow wrapper by meams of an iframe across domains and to use a parent and child handshake to ensure that my actual contemt is gated indirectly by that means. I very much appreciate your replies and attempts to assist Josh. And yes, there are those of us who still hand code sites. I have hand coded sites for more than 20 years and the site I want to gate is a large, highly complex very dymamic website witn HTML, CSS and Javascript all of which has been hand coded in notepad. Doing this offers the most control by far and it results in code which is very compact, quick to load and is easy to maintain. Wherever possible I avoid WYSIWYG editors for that reason. Thanks again. Much appreciate your time..
You can still use the webflow package. If you send your url i can guide you through and send some html. I have only been using vs code for the last 6 years, before that it was many many years of notepad ++ and filezilla lol. I know the struggle. :)
Please sign in to leave a comment.