Integration Guide
Add this script to your website before the closing </body> tag:
<script type="module">
import { dropInLoader } from "https://dropins.simplyclub.co.il/drop-ins/drop-in-loader/index.mjs";
const instance = await dropInLoader.setConfig({
poiId: "YOUR_POI_ID_HERE"
});
</script>
Contact SimplyClub support to get your POI ID before integrating.
Here's a full working example with all common features:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<button id="click-me">Join Simply Club</button>
<button id="logout">Logout</button>
<button id="open-manually">Open Modal</button>
<script type="module">
import { dropInLoader } from "https://dropins.simplyclub.co.il/drop-ins/drop-in-loader/index.mjs";
dropInLoader
.setConfig({
poiId: "YOUR_POI_ID_HERE",
starterBtn: {
selector: "#click-me" // This button will open the modal automatically
}
})
.then((self) => {
// Open modal manually from another button
document.getElementById("open-manually").addEventListener("click", () => {
self.commands.show();
});
// Logout handler
document.getElementById("logout").addEventListener("click", () => {
self.commands.logout();
});
// Set cart data
self.commands.setCart({
items: [{ id: "product-123", price: 150, title: "Product Name", sku: "SKU-001" }]
});
// Set user data
self.commands.setUser({
id: "user-123",
firstName: "John",
lastName: "Doe",
email: "john@example.com",
phone: "0501234567"
});
// Listen to events
self.On.benefitSelectionsChanged((e) => {
console.log("Benefits changed:", e);
});
self.On.redirectToLogin(() => {
window.location.href = "/login";
});
});
</script>
</body>
</html>
Use starterBtn.selector to automatically attach to a button, or call instance.commands.show() programmatically from within the promise callback.
| Property | Type | Required | Description |
|---|---|---|---|
poiId |
string |
Required | Your Point of Interest ID |
starterBtn.selector |
string |
Optional | CSS selector for button that opens the modal |
Opens the Simply Club modal.
Closes the Simply Club modal.
Sets the current user data. Pass null to clear.
Sets the shopping cart data.
Required for each item:
id OR line_id OR product_id (at least one)pricedescription OR name OR title (at least one)sku OR SKU (at least one)All other fields are optional.
Logs out the current user.
Gets the current session data.
Fired when user selects or changes benefits.
Fired when user needs to be redirected to login.
Fired when a transaction code is created.
Fired when a membership product is selected.
Contact SimplyClub support: