<script src="https://instant-push-demo.netlify.app/push-client-bundle.js"></script>
<link rel="stylesheet" href="https://instant-push-demo.netlify.app/push.css">
<script>
const push = InstantPush.init({
account: "YourAccount",
serverKey: "YourServerKey",
emailSelector: "#myHiddenEmail", // the selector of a (hidden) element containing the contact's email address
subscribeTrigger: "#mySubButton", // selector for a push subscribe button. OR "auto" to show without a click
unsubscribeTrigger: "#myUnsubButton" // selecto for an unsubscribe button
});
</script>
<script src="https://instant-push-demo.netlify.app/push-client-bundle.js"></script>
<link rel="stylesheet" href="https://instant-push-demo.netlify.app/push.css">
<script>
const push = InstantPush.init({
account: "YourAccount",
serverKey: "YourServerKey",
emailSelector: "#myHiddenEmail", // the selector of a (hidden) element containing the contact's email address
checkboxSelector: "input[name='myPushCheckbox']", // selector for a checkbox to subscribe/unsubscribe
});
</script>
The example below shows customizing the success UI, the auto-close timer, and disabling close on background-click:
<script>
const push = InstantPush.init({
account: "YourAccount",
serverKey: "YourServerKey",
emailSelector: "#myHiddenEmail", // the selector of a (hidden) element containing the contact's email address
subscribeTrigger: "#mySubButton", // selector for a push subscribe button. OR "auto" to show without a click
unsubscribeTrigger: "#myUnsubButton", // selecto for an unsubscribe button
ui_subscribed: `<h5>Great success!</h5><br>`, // override the "subscribed" part of the UI
autoCloseTimer: 1000,
bgCloseOnClick: false
});
</script>