1.0.4 • Published 2 years ago
@criclabs/galderma-web v1.0.4
Galderma Web
Usage
- Include following script tag to page head in the site setting or specific page.
- Update
version
of the module.
<script
defer
src="https://cdn.jsdelivr.net/npm/@criclabs/galderma-web@{version}/dist/galderma-web.js"
></script>
- On the Webflow page, initialize the component in the
head
section.
<script>
window.addEventListener("DOMContentLoaded", () => {
const buttonElement = document.querySelector("#unique-button");
if (buttonElement) {
new GaldermaWeb.Button(buttonElement);
}
});
</script>
Local Development
The following instructions for setting up a local development environment allow you to develop the web component locally and see the changes you make reflected on the Webflow site.
Prerequisites
- Install ngrok on your local machine.
- Sign in to ngrok and configure your authentication token on your machine.
ngrok config add-authtoken YOUR-AUTH-TOKRN
Setup Local Development
- Run the ngrok's file server with following command:
ngrok http file://$PWD
- Get the public URL from the ngrok console and visit the URL from your browser then click on "Visit Site".
- On the WebFlow's custom code setting, comment out the script tag of the original module and add the module you are working on.
<!-- <script defer src="ORIGINAL_MODULE_URL"></script> -->
<script defer src="NGROK_PUBLIC_URL/dist/galderma-web.js"></script>